* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #f1f5f9;
  min-height: 100vh;
  padding: 48px 24px;
}

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

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 12px;
  background: linear-gradient(90deg, #60a5fa, #c084fc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sub { color: #cbd5e1; font-size: 1.05rem; }

h1 code {
  background: transparent;
  padding: 0;
  background-image: linear-gradient(90deg, #60a5fa, #c084fc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.sub code {
  background: #334155;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 10px;
  background: #7c3aed;
  color: white;
  border-radius: 999px;
  font-size: 0.8rem;
}

.examples {
  max-width: 1100px;
  margin: 0 auto 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  padding: 20px;
}

.code {
  position: relative;
  background: #0b1220;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  display: flex;
  align-items: center;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.copy-btn:hover {
  background: rgba(148, 163, 184, 0.22);
  color: #f1f5f9;
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.code pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #cbd5e1;
  white-space: pre;
}

.code b {
  color: #f472b6;
  font-weight: 600;
}

.preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 20px;
}

.card {
  width: 260px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 1.05rem;
  border-radius: 36px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
  transition: transform 0.3s ease;
}

.card:hover { transform: translateY(-4px); }

/* corner-shape variants */
.round     { corner-shape: round; }
.squircle  { corner-shape: squircle; background: linear-gradient(135deg, #f472b6, #ec4899); box-shadow: 0 10px 30px rgba(236,72,153,0.35); }
.bevel     { corner-shape: bevel; background: linear-gradient(135deg, #f59e0b, #ef4444); box-shadow: 0 10px 30px rgba(239,68,68,0.35); }
.notch     { corner-shape: notch; background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 10px 30px rgba(16,185,129,0.35); }
.scoop     { corner-shape: scoop; background: linear-gradient(135deg, #06b6d4, #3b82f6); box-shadow: 0 10px 30px rgba(6,182,212,0.35); }
.square    { corner-shape: square; background: linear-gradient(135deg, #64748b, #334155); box-shadow: 0 10px 30px rgba(51,65,85,0.4); }
.two-val   { corner-shape: notch superellipse(0.6); background: linear-gradient(135deg, #14b8a6, #0ea5e9); box-shadow: 0 10px 30px rgba(20,184,166,0.35); }
.superellipse-pos { corner-shape: superellipse(3); background: linear-gradient(135deg, #a3e635, #22c55e); box-shadow: 0 10px 30px rgba(34,197,94,0.35); }
.mixed     { corner-shape: scoop notch squircle bevel; background: linear-gradient(135deg, #c084fc, #7c3aed); box-shadow: 0 10px 30px rgba(124,58,237,0.4); }
.superellipse { corner-shape: superellipse(-1.5); background: linear-gradient(135deg, #fbbf24, #f97316); box-shadow: 0 10px 30px rgba(251,191,36,0.35); }

.card.morph {
  border-radius: 50px;
  background: linear-gradient(135deg, #60a5fa, #c084fc);
  box-shadow: 0 20px 40px rgba(96,165,250,0.4);
  animation: morph 6s ease-in-out infinite alternate;
}

@keyframes morph {
  0%   { corner-shape: squircle; }
  50%  { corner-shape: notch; }
  100% { corner-shape: bevel; }
}

footer {
  text-align: center;
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto;
  font-size: 0.95rem;
}

footer code {
  background: #334155;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
}

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