/* =========================================
   CK STACKS — Design System & Styles
   Mobile-first, premium dark aesthetic
   ========================================= */

:root {
  --bg-base: #07070f;
  --bg-surface: #0f0f1e;
  --bg-card: #13132a;
  --bg-card-hover: #1a1a36;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(99,102,241,0.4);

  --accent-purple: #6366f1;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-violet: #8b5cf6;

  --text-primary: #f1f0ff;
  --text-secondary: #9898c0;
  --text-muted: #5858a0;

  --gradient-main: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  --gradient-card: linear-gradient(145deg, #13132a, #0a0a1a);
  --glow-purple: 0 0 40px rgba(99,102,241,0.25);
  --glow-pink: 0 0 40px rgba(236,72,153,0.2);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.04) inset;
  --shadow-btn: 0 4px 20px rgba(99,102,241,0.35);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Ambient Background Blobs ── */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
}
.blob-1 {
  width: 500px; height: 500px;
  background: var(--accent-purple);
  top: -150px; left: -150px;
  animation: blobFloat1 12s ease-in-out infinite alternate;
}
.blob-2 {
  width: 400px; height: 400px;
  background: var(--accent-pink);
  top: 40%; right: -120px;
  animation: blobFloat2 15s ease-in-out infinite alternate;
}
.blob-3 {
  width: 350px; height: 350px;
  background: var(--accent-violet);
  bottom: 10%; left: 20%;
  animation: blobFloat3 10s ease-in-out infinite alternate;
}
@keyframes blobFloat1 { from { transform: translate(0,0) scale(1); } to { transform: translate(40px, 60px) scale(1.1); } }
@keyframes blobFloat2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-30px, 50px) scale(1.08); } }
@keyframes blobFloat3 { from { transform: translate(0,0) scale(1); } to { transform: translate(20px, -40px) scale(1.05); } }

/* ── Header ── */
.ck-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(7, 7, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.ck-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ck-logo-icon {
  width: 30px; height: 30px;
  background: var(--gradient-main);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}
.ck-logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}
.ck-logo-badge {
  color: var(--accent-purple);
  font-size: 12px;
  margin-left: 2px;
  vertical-align: super;
}
.ck-header-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-purple);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid rgba(99,102,241,0.4);
  border-radius: var(--radius-full);
  transition: var(--transition);
}
.ck-header-cta:hover {
  background: rgba(99,102,241,0.15);
  border-color: var(--accent-purple);
}

/* ── Main Container ── */
.stack-container {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 84px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Creator Card ── */
.creator-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 22px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.6s ease both;
}

.creator-avatar-wrapper {
  position: relative;
}
.creator-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid transparent;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              var(--gradient-main) border-box;
  box-shadow: var(--glow-purple);
}
.creator-avatar svg { width: 100%; height: 100%; }
.creator-verified-badge {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 20px; height: 20px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  border: 2px solid var(--bg-base);
  color: white;
}

.creator-info { text-align: center; }
.creator-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.creator-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.creator-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-purple);
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.stack-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.meta-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: var(--radius-full);
}
.meta-icon { font-size: 13px; }

.savings-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.savings-icon { font-size: 18px; }
.savings-text {
  font-size: 13px;
  color: var(--text-secondary);
}
.savings-text strong { color: var(--accent-emerald); }

/* ── Stack Title ── */
.stack-title-block {
  padding-left: 4px;
  animation: fadeInUp 0.6s 0.1s ease both;
}
.stack-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.stack-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Products List ── */
.products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Product Card ── */
.product-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  animation: fadeInUp 0.6s ease both;
  cursor: default;
}
.product-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--glow-purple);
}
.product-card.featured {
  border-color: rgba(99,102,241,0.35);
  background: linear-gradient(145deg, #15153a, #0a0a1a);
}
.featured-glow {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.product-rank {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.product-image-wrap {
  position: relative;
  align-self: center;
}
.product-image {
  width: 130px;
  height: 95px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.monitor-img    { background: linear-gradient(135deg, #1e1e2e, #12122a); }
.headphones-img { background: linear-gradient(135deg, #2d0a1f, #1a0a14); }
.esp32-img      { background: linear-gradient(135deg, #031a10, #041a0e); }
.mouse-img      { background: linear-gradient(135deg, #1a1500, #1a1200); }
.stand-img      { background: linear-gradient(135deg, #150a2d, #0e0720); }
.product-image svg { width: 100%; height: 100%; }

.product-badge {
  position: absolute;
  top: -6px; right: -6px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.35);
  color: #a5a8ff;
  white-space: nowrap;
}
.product-badge.essential  { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.4); color: #fcd34d; }
.product-badge.top-pick   { background: rgba(236,72,153,0.15); border-color: rgba(236,72,153,0.4); color: #f9a8d4; }
.product-badge.creator-fav { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.4); color: #6ee7b7; }

.product-info { flex: 1; }
.product-store {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.product-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
  line-height: 1.3;
}
.product-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 10px;
}

.product-pricing {}
.pricing-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.price-current {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.price-original {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
}
.price-discount {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(16,185,129,0.1);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.cashback-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-amber);
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  padding: 5px 10px;
  border-radius: var(--radius-full);
}
.cashback-icon { font-size: 13px; }

/* ── Buy Button ── */
.buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  transition: var(--transition);
  cursor: pointer;
}
.buy-btn:hover {
  background: rgba(99,102,241,0.28);
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-btn);
  transform: translateY(-1px);
}
.buy-btn.featured-btn {
  background: var(--gradient-main);
  border-color: transparent;
  box-shadow: var(--shadow-btn);
}
.buy-btn.featured-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(99,102,241,0.5);
}

/* ── Savings Summary ── */
.savings-summary {
  animation: fadeInUp 0.6s 0.3s ease both;
}
.savings-card {
  background: var(--gradient-card);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  box-shadow: var(--shadow-card);
}
.savings-header {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.savings-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.savings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.savings-item:last-child { border-bottom: none; }
.savings-item.total { padding-top: 12px; }
.savings-label { font-size: 13px; color: var(--text-secondary); }
.savings-value { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.savings-value.strikethrough { text-decoration: line-through; color: var(--text-muted); }
.savings-value.green { color: var(--accent-emerald); }
.savings-value.big-green {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-emerald);
}

.full-stack-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 15px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, #059669, #10b981);
  text-decoration: none;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(16,185,129,0.3);
}
.full-stack-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16,185,129,0.45);
}

/* ── Creator CTA ── */
.creator-cta-section {
  animation: fadeInUp 0.6s 0.4s ease both;
}
.cta-card {
  background: linear-gradient(145deg, #12122b, #0a0a1e);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card), var(--glow-purple);
}
.cta-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
}
.cta-icon-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.cta-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
}
.cta-avatar.you {
  background: rgba(99,102,241,0.15);
  border: 2px dashed rgba(99,102,241,0.5);
  color: var(--text-muted);
  font-size: 11px;
}
.cta-chain { font-size: 20px; color: var(--text-muted); }
.cta-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.35;
}
.cta-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}
.cta-btn {
  display: block;
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  color: white;
  background: var(--gradient-main);
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow-btn);
  margin-bottom: 10px;
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,0.5);
  opacity: 0.95;
}
.cta-footnote {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Footer ── */
.stack-footer {
  text-align: center;
  padding: 20px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeInUp 0.6s 0.5s ease both;
}
.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.footer-ck {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-secondary);
}
.footer-stacks {
  font-size: 12px;
  color: var(--accent-purple);
}
.footer-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto;
}
.footer-links {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.footer-links a {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text-secondary); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(19, 19, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  z-index: 999;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast-icon { font-size: 16px; }

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger product cards */
.product-card:nth-child(1) { animation-delay: 0.15s; }
.product-card:nth-child(2) { animation-delay: 0.22s; }
.product-card:nth-child(3) { animation-delay: 0.29s; }
.product-card:nth-child(4) { animation-delay: 0.36s; }
.product-card:nth-child(5) { animation-delay: 0.43s; }

/* ── Responsive ── */
@media (min-width: 520px) {
  .stack-container { padding: 94px 24px 60px; }
  .product-image { width: 150px; height: 110px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 4px; }
