* { box-sizing: border-box; }

body {
  margin: 0;
  background: #0F1218;
  font-family: 'Space Grotesk', sans-serif;
  color: #EDEBE4;
}

.cp-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

.cp-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  color: #8B90A0;
  margin: 0 0 12px;
}

.cp-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  font-weight: 600;
  max-width: 14ch;
  margin: 0 0 16px;
}

.cp-sub {
  max-width: 52ch;
  color: #B7BAC6;
  line-height: 1.6;
  margin: 0 0 48px;
}

.cp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

@media (max-width: 640px) {
  .cp-grid { grid-template-columns: 1fr; gap: 20px; }
}

.cp-card {
  position: relative;
  background: #F7F5F0;
  color: #1B1B18;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px -28px var(--accent-shadow, rgba(0,0,0,0.3));
}

/* Fills the leftover space when a card is stretched to match a taller
   neighbour in the same row, instead of leaving it visibly empty */
.cp-card__stamp {
  position: absolute;
  right: 4px;
  bottom: -18px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 5rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.07;
  transform: rotate(-6deg);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.cp-card__stamp--sm {
  font-size: 3.4rem;
  bottom: -8px;
}

.cp-card__tab,
.cp-card__body {
  position: relative;
  z-index: 1;
}

.cp-card__tab {
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.95rem;
}

.cp-card__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3EE07A;
  flex-shrink: 0;
  animation: cp-pulse 2s infinite;
}

@keyframes cp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(62,224,122,0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(62,224,122,0); }
  100% { box-shadow: 0 0 0 0 rgba(62,224,122,0); }
}

@media (prefers-reduced-motion: reduce) {
  .cp-card__dot { animation: none; }
}

.cp-card__live {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  opacity: 0.9;
}

.cp-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cp-card__body--badge {
  padding: 16px;
  align-items: stretch;
  justify-content: center;
}

.cp-badge-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 6%, #FFFFFF);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 4px;
  overflow: hidden;
}

/* LeetCode's card is a wide banner (~2.5:1) */
.cp-badge-frame--leetcode {
  aspect-ratio: 5 / 2;
  padding: 14px;
}

/* GFG's card is closer to square, so it needs its own ratio
   and less padding, or it shrinks and leaves whitespace */
.cp-badge-frame--gfg {
  aspect-ratio: 4 / 3;
  padding: 6px;
}

.cp-badge-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.cp-stat-big {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
}

.cp-stat-label {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: #5B5B54;
}

.cp-stat-label span {
  color: #1B1B18;
  font-weight: 500;
}

.cp-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.cp-stat-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-num {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 1.15rem;
}

.cp-lbl {
  font-size: 0.72rem;
  color: #7A7A70;
}

.cp-card__link {
  margin-top: 20px;
  align-self: flex-start;
  font-size: 0.85rem;
  color: #1B1B18;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.cp-card__link:hover { opacity: 0.7; }

.cp-note {
  margin-top: 10px;
  font-size: 0.72rem;
  color: #8A8A80;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .cp-page { padding: 40px 16px 64px; }
  .cp-stat-big { font-size: 2rem; }
}