/* ═══════════════════════════════════════════════════════════
   Interactive Showcase Page Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Layout & Section Base ──────────────────────────────── */
.showcase-hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #04080c;
}

#threejs-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(88,215,255,0.08);
  border: 1px solid rgba(88,215,255,0.2);
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 0.8rem;
  color: var(--cyan, #58d7ff);
  margin-bottom: 24px;
  letter-spacing: 0.06em;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: var(--muted, #8b949e);
  line-height: 1.7;
  margin-bottom: 40px;
}

.hero-scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted, #8b949e);
  font-size: 0.8rem;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--muted, #8b949e);
  border-bottom: 2px solid var(--muted, #8b949e);
  transform: rotate(45deg);
  animation: scrollArrow 1.5s ease-in-out infinite;
}

@keyframes scrollArrow {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 1; }
  50% { transform: rotate(45deg) translateY(4px); opacity: 0.4; }
}

/* ── Showcase Sections ─────────────────────────────────── */
.showcase-section {
  padding: 100px 40px;
  max-width: 1280px;
  margin: 0 auto;
}

.showcase-section.alt-bg {
  max-width: none;
  background: rgba(255,255,255,0.015);
  border-top: 1px solid var(--border, #21262d);
  border-bottom: 1px solid var(--border, #21262d);
  padding-left: max(40px, calc(50vw - 640px));
  padding-right: max(40px, calc(50vw - 640px));
}

.section-header {
  margin-bottom: 56px;
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--cyan, #58d7ff);
  background: rgba(88,215,255,0.08);
  border: 1px solid rgba(88,215,255,0.2);
  border-radius: 4px;
  padding: 2px 10px;
  margin-bottom: 16px;
  letter-spacing: 0.1em;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--muted, #8b949e);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Tech Nav ──────────────────────────────────────────── */
.tech-nav {
  position: sticky;
  top: var(--nav-h, 64px);
  z-index: 50;
  background: rgba(8,12,16,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border, #21262d);
  overflow-x: auto;
  scrollbar-width: none;
}

.tech-nav::-webkit-scrollbar { display: none; }

.tech-nav-inner {
  display: flex;
  gap: 8px;
  padding: 12px 40px;
  white-space: nowrap;
}

.tech-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 0.78rem;
  color: var(--muted, #8b949e);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.tech-pill:hover, .tech-pill.active {
  color: var(--cyan, #58d7ff);
  border-color: rgba(88,215,255,0.3);
  background: rgba(88,215,255,0.07);
}

/* ── Demo Grid ─────────────────────────────────────────── */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.demo-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #21262d);
  border-radius: 16px;
  padding: 28px;
  transition: border-color 0.3s, transform 0.3s;
  --cx: 50%;
  --cy: 50%;
}

.demo-card:hover {
  border-color: rgba(88,215,255,0.3);
  transform: translateY(-2px);
}

.demo-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text, #e6edf3);
}

/* ── PWA Install Bar ───────────────────────────────────── */
.pwa-install-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(16,22,30,0.98);
  border: 1px solid rgba(88,215,255,0.3);
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  transition: opacity 0.3s, transform 0.3s;
}

.pwa-install-bar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

/* ── CSS Animations Demo ────────────────────────────────── */
/* Card Flip */
.flip-card-scene {
  perspective: 600px;
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.flip-card {
  width: 140px;
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.flip-card-scene:hover .flip-card {
  transform: rotateY(180deg);
}

.flip-front, .flip-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backface-visibility: hidden;
  font-size: 0.85rem;
}

.flip-front {
  background: rgba(88,215,255,0.08);
  border: 1px solid rgba(88,215,255,0.2);
}

.flip-back {
  background: rgba(181,156,255,0.1);
  border: 1px solid rgba(181,156,255,0.3);
  transform: rotateY(180deg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--cyan, #58d7ff);
  padding: 8px;
  text-align: center;
}

.flip-icon { font-size: 2rem; }

/* Morph Button */
.morph-demo { display: flex; justify-content: center; }

.morph-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, rgba(88,215,255,0.15), rgba(181,156,255,0.15));
  border: 1px solid rgba(88,215,255,0.4);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.5s, transform 0.3s;
}

.morph-btn.morphed {
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(88,215,255,0.3), rgba(123,240,190,0.2));
  transform: scale(1.05);
}

/* Spinner Showcase */
.spinner-showcase {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 12px;
}

.spinner-dna {
  width: 40px;
  height: 40px;
  border: 3px solid transparent;
  border-top-color: var(--cyan, #58d7ff);
  border-bottom-color: var(--purple, #b59cff);
  border-radius: 50%;
  animation: spinDNA 1s linear infinite;
}

@keyframes spinDNA {
  to { transform: rotate(360deg); }
}

.spinner-ring {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(88,215,255,0.15);
  border-top-color: var(--cyan, #58d7ff);
  border-radius: 50%;
  animation: spinDNA 0.7s ease-in-out infinite;
  position: relative;
}

.spinner-ring::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 2px solid rgba(123,240,190,0.2);
  border-bottom-color: #7bf0be;
  border-radius: 50%;
  animation: spinDNA 1.4s linear infinite reverse;
}

.spinner-pulse {
  width: 16px;
  height: 16px;
  background: var(--cyan, #58d7ff);
  border-radius: 50%;
  animation: pulsate 1s ease-in-out infinite;
}

@keyframes pulsate {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(88,215,255,0.4); }
  50% { transform: scale(1.3); opacity: 0.7; box-shadow: 0 0 0 12px rgba(88,215,255,0); }
}

/* Glitch Text */
.glitch-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80px;
}

.glitch-text {
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
}

.glitch-text::before {
  color: var(--cyan, #58d7ff);
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  animation: glitchTop 3s infinite;
}

.glitch-text::after {
  color: var(--purple, #b59cff);
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  animation: glitchBot 3s infinite;
}

@keyframes glitchTop {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-3px, 1px); }
  94% { transform: translate(2px, -1px); }
  96% { transform: translate(-1px, 0); }
}

@keyframes glitchBot {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(3px, 1px); }
  94% { transform: translate(-2px, -1px); }
  96% { transform: translate(1px, 0); }
}

/* CSS Progress Bars */
.css-progress-list { display: flex; flex-direction: column; gap: 12px; }

.css-progress-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
}

.css-progress-item > span { min-width: 60px; color: var(--muted); }

.css-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.css-bar-fill {
  height: 100%;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, var(--cyan, #58d7ff), var(--purple, #b59cff));
  border-radius: 3px;
  animation: fillBar 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform-origin: left;
}

@keyframes fillBar {
  from { width: 0; }
  to { width: var(--pct, 0%); }
}

/* Neon Text */
.neon-demo {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  height: 80px;
}

.neon-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cyan, #58d7ff);
  text-shadow:
    0 0 6px currentColor,
    0 0 20px currentColor,
    0 0 40px currentColor;
  animation: neonFlicker 4s ease-in-out infinite;
}

.neon-green { color: #7bf0be; }
.neon-purple { color: var(--purple, #b59cff); }

@keyframes neonFlicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow: 0 0 6px currentColor, 0 0 20px currentColor, 0 0 40px currentColor;
  }
  20%, 24%, 55% { text-shadow: none; }
}

/* ── Web Animations API Demo ───────────────────────────── */
.waa-demo {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 32px;
  align-items: start;
  max-width: 800px;
  margin: 0 auto;
}

.waa-stage {
  grid-column: 1;
  grid-row: 1;
  height: 200px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border, #21262d);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.waa-molecule {
  position: relative;
  width: 120px;
  height: 120px;
}

.atom {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #000;
}

.atom-c  { width: 36px; height: 36px; background: #555; top: 42px; left: 42px; }
.atom-n  { width: 30px; height: 30px; background: #4477ee; top: 8px; left: 45px; color: #fff; }
.atom-o  { width: 28px; height: 28px; background: #ee4444; top: 82px; left: 46px; color: #fff; }
.atom-h1 { width: 22px; height: 22px; background: #aaa; top: 48px; left: 4px; }
.atom-h2 { width: 22px; height: 22px; background: #aaa; top: 48px; left: 94px; }

.bond {
  position: absolute;
  height: 2px;
  background: rgba(200,200,200,0.4);
  transform-origin: left center;
}

.bond-1 { width: 40px; top: 57px; left: 42px; transform: rotate(-90deg) translateX(-40px); }
.bond-2 { width: 40px; top: 57px; left: 42px; transform: rotate(90deg); }

.waa-controls {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ctrl-btn {
  padding: 8px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #21262d);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  text-align: left;
  transition: all 0.2s;
  white-space: nowrap;
}

.ctrl-btn:hover {
  border-color: rgba(88,215,255,0.4);
  background: rgba(88,215,255,0.06);
}

.waa-info {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.waa-info code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--cyan, #58d7ff);
  background: rgba(88,215,255,0.06);
  border: 1px solid rgba(88,215,255,0.15);
  border-radius: 6px;
  padding: 4px 12px;
}

/* ── Canvas Demos ──────────────────────────────────────── */
.canvas-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #21262d);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.tab-btn.active, .tab-btn:hover {
  color: var(--cyan, #58d7ff);
  border-color: rgba(88,215,255,0.4);
  background: rgba(88,215,255,0.06);
}

.canvas-wrapper { display: block; }
.canvas-wrapper.hidden { display: none; }

.draw-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border, #21262d);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
}

.tool-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.tool-btn {
  padding: 6px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #21262d);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.tool-btn:hover {
  border-color: rgba(88,215,255,0.4);
  color: var(--cyan, #58d7ff);
}

.drawing-canvas {
  display: block;
  width: 100%;
  height: 400px;
  border: 1px solid var(--border, #21262d);
  border-radius: 0 0 12px 12px;
  cursor: crosshair;
  background: #060a0e;
  touch-action: none;
}

/* ── Scroll Timeline ───────────────────────────────────── */
.scroll-demo-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.scroll-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--border, #21262d);
  margin-left: 20px;
}

.tl-step {
  position: relative;
  padding: 0 0 48px 40px;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.6s cubic-bezier(0.4,0,0.2,1);
}

.tl-step.visible {
  opacity: 1;
  transform: translateX(0);
}

.tl-dot {
  position: absolute;
  left: -10px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg, #0a1116);
  border: 2px solid var(--border, #21262d);
  transition: all 0.4s;
}

.tl-step.visible .tl-dot {
  border-color: var(--cyan, #58d7ff);
  box-shadow: 0 0 12px rgba(88,215,255,0.4);
  background: rgba(88,215,255,0.1);
}

.tl-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.tl-content p {
  font-size: 0.85rem;
  color: var(--muted, #8b949e);
}

.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan, #58d7ff), var(--purple, #b59cff));
  transition: width 0.1s;
  z-index: 999;
}

/* ── Parallax ──────────────────────────────────────────── */
.parallax-section {
  position: relative;
  height: 60vh;
  min-height: 400px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  max-width: none !important;
  border-top: 1px solid var(--border, #21262d);
  border-bottom: 1px solid var(--border, #21262d);
  padding: 0;
  margin: 0;
}

.parallax-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.parallax-bg { background: radial-gradient(ellipse at center, rgba(88,215,255,0.03) 0%, transparent 70%); }

.stars-field {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: var(--op, 0.3); }
  50% { opacity: 0.05; }
}

.floating-dna {
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0.2;
}

.dna-rung {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan, #58d7ff), var(--purple, #b59cff));
  border-radius: 1px;
  animation: dnaWave 3s ease-in-out infinite;
}

.dna-rung:nth-child(odd) { animation-delay: -0.5s; }
.dna-rung:nth-child(2) { animation-delay: -1s; }
.dna-rung:nth-child(4) { animation-delay: -2s; }

@keyframes dnaWave {
  0%, 100% { transform: scaleX(1) translateX(0); }
  50% { transform: scaleX(0.6) translateX(20px); }
}

.parallax-fg .section-header { z-index: 3; }
.parallax-fg .section-header h2 { color: #fff; text-shadow: 0 2px 20px rgba(0,0,0,0.8); }

/* ── Micro-interactions ────────────────────────────────── */
.micro-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ripple-btn {
  position: relative;
  overflow: hidden;
  padding: 10px 24px;
  background: rgba(88,215,255,0.1);
  border: 1px solid rgba(88,215,255,0.3);
  border-radius: 8px;
  color: var(--cyan, #58d7ff);
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.2s;
}

.ripple-btn.ripple-green {
  background: rgba(123,240,190,0.1);
  border-color: rgba(123,240,190,0.3);
  color: #7bf0be;
}

.ripple-btn.ripple-red {
  background: rgba(255,100,100,0.1);
  border-color: rgba(255,100,100,0.3);
  color: #ff6464;
}

.ripple-btn .ripple-wave {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* Like Button */
.like-row { gap: 20px; }

.like-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border, #21262d);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 60px;
}

.like-btn:hover { border-color: rgba(255,100,100,0.4); }

.like-btn.liked {
  border-color: rgba(255,100,100,0.6);
  background: rgba(255,100,100,0.08);
}

.heart-icon {
  font-size: 1.4rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s;
  display: block;
}

.like-btn.liked .heart-icon {
  color: #ff6464;
  transform: scale(1.3);
  animation: heartBeat 0.4s ease-in-out;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1.3); }
  50% { transform: scale(1.5); }
}

.like-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  transition: color 0.3s;
}

.like-btn.liked .like-count { color: #ff6464; }

/* Toggle */
.toggle-list { flex-direction: column; align-items: flex-start; gap: 16px; }

.toggle-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
}

.toggle-input { display: none; }

.toggle-slider {
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-input:checked + .toggle-slider { background: rgba(88,215,255,0.5); }
.toggle-input:checked + .toggle-cyan { background: rgba(88,215,255,0.5); }
.toggle-input:checked + .toggle-purple { background: rgba(181,156,255,0.5); }
.toggle-input:checked + .toggle-red { background: rgba(255,100,100,0.5); }
.toggle-input:checked + .toggle-slider::after { transform: translateX(20px); }

/* Skeleton */
.skeleton-demo {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.sk-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }

.sk-line {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.sk-w80 { width: 80%; }
.sk-w60 { width: 60%; }
.sk-w90 { width: 90%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Magnetic Button */
.magnetic-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, rgba(88,215,255,0.1), rgba(181,156,255,0.1));
  border: 1px solid rgba(88,215,255,0.4);
  border-radius: 50px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: box-shadow 0.3s;
  will-change: transform;
}

.magnetic-btn:hover {
  box-shadow: 0 8px 32px rgba(88,215,255,0.2);
}

/* Cursor Trail */
.cursor-trail-demo {
  height: 150px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border, #21262d);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.trail-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan, #58d7ff);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  animation: trailFade 0.8s ease-out forwards;
}

@keyframes trailFade {
  to { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* ── Intersection Observer Stats ────────────────────────── */
.stat-card {
  background: rgba(88,215,255,0.04);
  border: 1px solid rgba(88,215,255,0.15);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: border-color 0.3s, transform 0.6s;
}

.stat-card.io-fired {
  border-color: rgba(88,215,255,0.4);
  transform: translateY(-4px);
}

.stat-val {
  font-size: 2.4rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cyan, #58d7ff);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--muted, #8b949e);
}

.lazy-images-row { margin-top: 48px; }

.demo-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.lazy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.lazy-img-wrapper {
  position: relative;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border, #21262d);
}

.lazy-placeholder {
  position: absolute;
  inset: 0;
}

.sk-shimmer {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.lazy-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lazy-img.loaded { opacity: 1; }

/* ── Speech API ─────────────────────────────────────────── */
.speech-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 680px) { .speech-demo { grid-template-columns: 1fr; } }

.speech-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #21262d);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.speech-panel h3 { font-size: 1rem; font-weight: 600; }

.speech-output {
  min-height: 80px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border, #21262d);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.88rem;
}

.speech-interim { color: var(--muted); font-style: italic; }
.speech-final { color: var(--text); margin-top: 4px; }

.speech-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  color: var(--cyan, #58d7ff);
}

.tts-textarea {
  width: 100%;
  height: 80px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border, #21262d);
  border-radius: 8px;
  color: var(--text);
  padding: 10px;
  font-size: 0.85rem;
  resize: none;
  font-family: inherit;
}

.tts-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tts-select {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border, #21262d);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 0.82rem;
}

.tts-btn-row { display: flex; gap: 8px; }

/* ── Real-time Demo ─────────────────────────────────────── */
.realtime-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

@media (max-width: 680px) { .realtime-demo { grid-template-columns: 1fr; } }

.rt-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #21262d);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rt-panel h3 { font-size: 0.95rem; font-weight: 600; }

.rt-controls { display: flex; align-items: center; gap: 8px; }

.rt-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
}

.rt-badge.online {
  border-color: rgba(123,240,190,0.4);
  color: #7bf0be;
  background: rgba(123,240,190,0.08);
}

.rt-ticker {
  flex: 1;
  overflow-y: auto;
  max-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.ticker-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1.5fr 1.5fr;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.ticker-header {
  color: var(--muted);
  font-size: 0.7rem;
  border-bottom: 1px solid var(--border, #21262d);
}

.ticker-row.up { background: rgba(123,240,190,0.05); color: #7bf0be; }
.ticker-row.down { background: rgba(255,100,100,0.05); color: #ff6464; }

.ws-chat {
  flex: 1;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ws-msg {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 8px;
  max-width: 80%;
}

.ws-msg.ws-sent {
  align-self: flex-end;
  background: rgba(88,215,255,0.1);
  border: 1px solid rgba(88,215,255,0.2);
  color: var(--cyan, #58d7ff);
}

.ws-msg.ws-recv {
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #21262d);
}

.ws-msg.ws-system {
  align-self: center;
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
  max-width: 100%;
  text-align: center;
}

.ws-input-row { display: flex; gap: 8px; }

.ws-input {
  flex: 1;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border, #21262d);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* ── A-Frame VR ─────────────────────────────────────────── */
.aframe-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.aframe-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.aframe-container {
  width: 100%;
  height: 450px;
  border: 1px solid var(--border, #21262d);
  border-radius: 16px;
  overflow: hidden;
  background: #04080c;
}

.aframe-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.aframe-icon { font-size: 4rem; }

.aframe-container a-scene,
.aframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── WebAssembly Demo ───────────────────────────────────── */
.wasm-demo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

@media (max-width: 720px) { .wasm-demo { grid-template-columns: 1fr; } }

.wasm-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #21262d);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wasm-panel h3 { font-size: 0.95rem; font-weight: 600; }

.wasm-controls { display: flex; gap: 8px; flex-wrap: wrap; }

.wasm-results { display: flex; flex-direction: column; gap: 12px; }

.wasm-result-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border, #21262d);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-lang { font-size: 0.78rem; color: var(--muted); }
.result-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.result-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.result-bar-wrap {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.result-bar {
  height: 100%;
  background: rgba(255,200,100,0.7);
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

.result-bar-cyan { background: var(--cyan, #58d7ff); }
.wasm-note { font-size: 0.82rem; text-align: center; }

.wasm-filter-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-input {
  font-size: 0.82rem;
  color: var(--muted);
}

.filter-btns { display: flex; flex-wrap: wrap; gap: 6px; }

.filter-btn {
  padding: 5px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border, #21262d);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
  border-color: rgba(88,215,255,0.4);
  color: var(--cyan, #58d7ff);
  background: rgba(88,215,255,0.06);
}

.wasm-canvases { display: flex; gap: 12px; }
.wasm-cv-wrap { flex: 1; text-align: center; font-size: 0.78rem; color: var(--muted); }
.wasm-canvas {
  width: 100%;
  max-height: 140px;
  border: 1px solid var(--border, #21262d);
  border-radius: 8px;
  display: block;
  margin-top: 4px;
  background: #040608;
}

/* ── PWA Demo ───────────────────────────────────────────── */
.pwa-demo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.pwa-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #21262d);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pwa-icon { font-size: 2.5rem; }
.pwa-card h3 { font-size: 0.88rem; font-weight: 600; }
.pwa-status { font-size: 0.78rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.pwa-status.ok { color: #7bf0be; }
.pwa-status.warn { color: #ffd080; }

.pwa-checklist {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border, #21262d);
  border-radius: 16px;
  padding: 28px;
  max-width: 600px;
  margin: 0 auto;
}

.pwa-checklist h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 16px; }

#pwa-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#pwa-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

#pwa-checklist li.pass { color: #7bf0be; }
#pwa-checklist li.fail { color: #ff8080; }

/* ── Accessibility Demo ─────────────────────────────────── */
.a11y-demo {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.a11y-status {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border, #21262d);
  border-radius: 12px;
  padding: 20px;
}

.a11y-icon { font-size: 2rem; }
.a11y-controls { display: flex; flex-direction: column; }

.a11y-demo-box {
  height: 100px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border, #21262d);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.a11y-ball {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--cyan, #58d7ff), var(--purple, #b59cff));
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  animation: ballBounce 1.5s ease-in-out infinite alternate;
}

@keyframes ballBounce {
  from { left: 24px; }
  to { left: calc(100% - 56px); }
}

@media (prefers-reduced-motion: reduce) {
  .a11y-ball { animation: none; }
  .neon-text { animation: none; }
  .scroll-arrow { animation: none; }
  .spinner-dna, .spinner-ring, .spinner-pulse { animation: none; }
  .glitch-text::before, .glitch-text::after { animation: none; }
}

.reduce-motion .a11y-ball { animation: none !important; }
.reduce-motion * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }

/* ── Footer ─────────────────────────────────────────────── */
.showcase-footer {
  text-align: center;
  padding: 48px 24px;
  border-top: 1px solid var(--border, #21262d);
  color: var(--muted, #8b949e);
  font-size: 0.82rem;
  line-height: 1.8;
}

/* ── Shared Utilities ───────────────────────────────────── */
.grad {
  background: linear-gradient(135deg, var(--cyan, #58d7ff), var(--purple, #b59cff));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn { cursor: pointer; font-size: 0.88rem; border-radius: 8px; transition: all 0.2s; font-weight: 500; }
.btn-primary { background: rgba(88,215,255,0.15); border: 1px solid rgba(88,215,255,0.4); color: var(--cyan, #58d7ff); padding: 10px 20px; }
.btn-primary:hover { background: rgba(88,215,255,0.25); }
.btn-ghost { background: transparent; border: 1px solid var(--border, #21262d); color: var(--muted); padding: 10px 20px; }
.btn-ghost:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.muted-text { color: var(--muted, #8b949e); font-size: 0.85rem; }
.mt-8 { margin-top: 8px; }
.hidden { display: none !important; }
.live-dot {
  width: 8px; height: 8px; background: var(--cyan, #58d7ff); border-radius: 50%;
  animation: pulsate 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .waa-demo { grid-template-columns: 1fr; }
  .waa-controls { flex-direction: row; flex-wrap: wrap; grid-column: 1; }
  .waa-stage { grid-column: 1; }
  .waa-info { grid-column: 1; }
}

@media (max-width: 640px) {
  .showcase-section { padding: 64px 20px; }
  .tech-nav-inner { padding: 10px 20px; }
}
