/* typography-demo.css — Visual design tokens showcase */

:root {
  /* Demo-specific tokens */
  --demo-card: var(--card);
  --demo-card-hover: var(--card-hover);
  --demo-radius: 14px 26px 10px 30px / 22px 12px 28px 14px;
}

.typography-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.type-pair {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--lavender-50);
  padding: var(--space-4);
  border-radius: var(--demo-radius);
  border: 2px solid var(--lavender-200);
  transition: all var(--transition-normal);
}

.type-pair:hover {
  border-color: var(--lavender-400);
  box-shadow: 0 0 20px rgba(183, 164, 206, 0.3);
  transform: translateY(-2px);
}

.type-label {
  font-size: var(--step--2);
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.type-sample {
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--slime-dark);
  font-family: "Rubik Wet Paint", "Comic Neue", cursive;
  -webkit-text-stroke: 1px var(--ink);
  paint-order: stroke fill;
  word-break: break-all;
}

.type-sample[data-step="step-6"] { font-size: var(--step-5); }
.type-sample[data-step="step-5"] { font-size: var(--step-4); }
.type-sample[data-step="step-4"] { font-size: var(--step-3); }
.type-sample[data-step="step-3"] { font-size: var(--step-2); }
.type-sample[data-step="step-2"] { font-size: var(--step-1); }
.type-sample[data-step="step-1"] { font-size: var(--step-0); }
.type-sample[data-step="step-0"] { font-size: var(--step--1); }
.type-sample[data-step="step--1"] { font-size: var(--step--2); }

/* Spacing Demo */
.spacing-demo {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.spacing-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.spacing-label {
  width: 120px;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.spacing-visual {
  flex: 1;
  height: var(--size, 8px);
  background: linear-gradient(90deg, var(--lavender-300), var(--lavender-500), var(--lavender-300));
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.spacing-visual::after {
  content: attr(style);
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--step--2);
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.spacing-palette {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.spacing-item {
  flex: 1;
  min-width: 80px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink);
  border-radius: 8px;
  box-shadow: 2px 3px 0 var(--shadow);
  transition: all var(--transition-normal);
}

.spacing-item:hover {
  transform: scale(1.05);
  box-shadow: 4px 6px 0 var(--slime-dark);
}

/* Lavender Palette */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.palette-item {
  aspect-ratio: 1;
  border-radius: var(--demo-radius);
  border: 3px solid var(--ink);
  box-shadow: 5px 7px 0 var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-3);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.palette-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.palette-item:hover::before {
  opacity: 1;
}

.palette-item:hover {
  transform: rotate(-2deg) scale(1.02);
  box-shadow: 8px 10px 0 var(--slime-dark);
  z-index: 10;
}

.palette-item:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.palette-name {
  font-size: var(--step--2);
  font-weight: 700;
  color: var(--ink);
  z-index: 1;
}

.palette-value {
  font-size: var(--step--2);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: var(--ink-soft);
  z-index: 1;
}

.palette-usage {
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: var(--lavender-50);
  border-radius: var(--demo-radius);
  border: 2px dashed var(--lavender-300);
}

.palette-usage h4 {
  margin: 0 0 var(--space-2);
  font-size: var(--step-1);
  color: var(--slime-dark);
}

.palette-usage ul {
  margin: 0;
  padding-left: var(--space-5);
}

.palette-usage li {
  margin: var(--space-1) 0;
  line-height: 1.6;
}

/* Card Hover Demo */
.hover-demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.hover-card {
  background: var(--demo-card);
  border: 3px solid var(--ink);
  border-radius: var(--demo-radius);
  box-shadow: 7px 9px 0 var(--shadow);
  padding: var(--space-5);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.hover-card:hover {
  translate: 0 -6px;
  box-shadow: 14px 16px 0 var(--slime-dark);
  background: var(--demo-card-hover);
  rotate: -0.5deg;
}

.hover-card:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.hover-card h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--step-2);
  color: var(--slime-dark);
}

.hover-card p {
  margin: 0;
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--ink-soft);
}

.hover-css {
  margin-top: var(--space-5);
}

/* Hero Demo */
.hero-demo {
  margin-top: var(--space-4);
  padding: var(--space-6) var(--space-4);
  background: linear-gradient(180deg, transparent 0%, var(--lavender-50) 50%, transparent 100%);
  border-radius: var(--demo-radius);
  border: 2px dashed var(--lavender-300);
}

.hero-demo .hero-avatar {
  width: clamp(100px, 18vw, 140px);
  height: clamp(100px, 18vw, 140px);
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: 4px 6px 0 var(--shadow), 0 0 30px rgba(183, 164, 206, 0.3);
  margin: 0 auto var(--space-3);
  rotate: -3deg;
  transition: all var(--transition-slow);
}

.hero-demo .hero-avatar:hover {
  rotate: 3deg;
  box-shadow: 6px 8px 0 var(--slime-dark), 0 0 40px rgba(183, 164, 206, 0.5);
}

.hero-demo .demo-title {
  margin: 0;
  line-height: .9;
  font: 400 var(--step-4)/.95 "Rubik Wet Paint", "Comic Neue", cursive;
  white-space: nowrap;
  color: var(--slime);
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  user-select: none;
}

.hero-demo .demo-title span {
  display: inline-block;
  animation: wobble 2.6s ease-in-out infinite;
  transform-origin: 50% 90%;
}

.hero-demo .demo-title span:nth-child(1) { animation-delay: -.3s; rotate: -6deg; }
.hero-demo .demo-title span:nth-child(2) { animation-delay: -1.1s; rotate: 4deg; translate: 0 .05em; }
.hero-demo .demo-title span:nth-child(3) { animation-delay: -.7s; rotate: -2deg; }
.hero-demo .demo-title span:nth-child(4) { animation-delay: -1.9s; rotate: 9deg; translate: 0 .08em; }
.hero-demo .demo-title span:nth-child(5) { animation-delay: -.5s; rotate: -4deg; }
.hero-demo .demo-title span:nth-child(6) { animation-delay: -1.5s; rotate: 7deg; }
.hero-demo .demo-title span:nth-child(7) { animation-delay: -2.3s; rotate: -3deg; }
.hero-demo .demo-title span:nth-child(8) { animation-delay: -.9s; rotate: 11deg; }

.hero-demo .tagline {
  font-size: var(--step-1);
  margin: var(--space-2) auto;
  font-weight: 700;
  color: var(--ink-soft);
}

.hero-demo .subtag {
  margin: var(--space-2) auto 0;
  max-width: 28em;
  opacity: .8;
  font-size: var(--step-0);
  line-height: 1.6;
}

.hero-css {
  margin-top: var(--space-5);
}

/* Code Details */
.code-details {
  margin-top: var(--space-4);
}

.code-details summary {
  cursor: pointer;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--accent);
  padding: var(--space-2) 0;
}

.code-details pre {
  background: #1d2b12;
  color: #b8ff7a;
  border: 3px solid var(--ink);
  border-radius: 6px 16px 8px 12px;
  padding: var(--space-4);
  overflow-x: auto;
  margin: var(--space-3) 0;
  font-size: var(--step--2);
  line-height: 1.6;
}

.code-details code {
  background: transparent;
  padding: 0;
  font-size: inherit;
}

/* Responsive */
@media (max-width: 600px) {
  .palette-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .spacing-label {
    width: 80px;
    font-size: var(--step--2);
  }

  .typography-demo {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .type-pair:hover,
  .palette-item:hover,
  .hover-card:hover,
  .hero-demo .hero-avatar:hover,
  .spacing-item:hover {
    transform: none;
    rotate: 0deg;
    box-shadow: none;
  }

  .type-pair:hover,
  .palette-item:hover {
    border-color: var(--lavender-400);
  }

  .hero-demo .demo-title span {
    animation: none;
    transform: none;
  }
}

/* === Button Styles Showcase === */
.button-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.button-demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.button-code {
  margin-top: var(--space-3);
}

/* Card Hover States Enhanced Section */
.card-hover-enhanced {
  margin-top: var(--space-5);
}

.card-hover-enhanced h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
  color: var(--slime-dark);
}

.card-examples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.card-example {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--demo-radius);
  padding: var(--space-4);
  text-align: center;
  min-width: 140px;
  transition: all var(--transition-normal);
}

.card-example:hover {
  translate: 0 -4px;
  box-shadow: 10px 12px 0 var(--slime-dark);
  background: var(--card-hover);
}

.card-example:focus-visible {
  outline: 3px solid var(--lavender-500);
  outline-offset: 3px;
}

.card-example small {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--step--2);
  color: var(--ink-soft);
}

/* === Color System Section === */
.color-system {
  margin-top: var(--space-5);
}

.color-system h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
  color: var(--slime-dark);
}

.color-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.color-swatch {
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.color-swatch:hover {
  transform: scale(1.05);
}

.color-swatch .color-value {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 2px solid var(--ink);
  margin: 0 auto var(--space-1);
  box-shadow: 2px 3px 0 var(--shadow);
}

.color-swatch .color-name {
  font-size: var(--step--2);
  font-weight: 700;
  color: var(--ink);
}

.color-swatch .color-hex {
  font-size: var(--step--2);
  font-family: ui-monospace, monospace;
  color: var(--ink-soft);
}

/* === Form Elements Showcase === */
.form-showcase {
  margin-top: var(--space-5);
}

.form-showcase h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
  color: var(--slime-dark);
}

.form-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.form-example {
  background: var(--lavender-50);
  border: 2px dashed var(--lavender-300);
  border-radius: var(--demo-radius);
  padding: var(--space-4);
}

.form-example label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink);
}

.form-example input,
.form-example select,
.form-example textarea {
  width: 100%;
  padding: var(--space-1);
  border: 2px solid var(--lavender-300);
  border-radius: 6px;
  font-size: var(--step-0);
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.form-example input:focus,
.form-example select:focus,
.form-example textarea:focus {
  outline: 2px solid var(--lavender-500);
  outline-offset: 2px;
}

/* === Toast Notifications === */
.toast-showcase {
  margin-top: var(--space-5);
}

.toast-showcase h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
  color: var(--slime-dark);
}

.toast-example {
  position: relative;
  padding: var(--space-4);
  background: var(--lavender-50);
  border-radius: var(--demo-radius);
  margin-bottom: var(--space-3);
}

.toast-example::before {
  content: 'toast notification';
  position: absolute;
  top: -10px;
  right: var(--space-4);
  background: var(--ink);
  color: #fff;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: var(--step--2);
  font-weight: 700;
}

/* === Badge Styles === */
.badge-showcase {
  margin-top: var(--space-5);
}

.badge-showcase h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
  color: var(--slime-dark);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  flex-direction: column;
}

.badge {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  border-radius: 20px;
  font-size: var(--step--2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-new {
  background: var(--lavender-500);
  color: #fff;
  box-shadow: 2px 3px 0 var(--shadow);
}

.badge-active {
  background: var(--lavender-300);
  color: var(--ink);
  box-shadow: 2px 3px 0 var(--slime-dark);
}

.badge-muted {
  background: var(--lavender-200);
  color: var(--ink-soft);
}

.badge-completed {
  background: var(--slime);
  color: #fff;
}

/* === Loading States === */
.loading-showcase {
  margin-top: var(--space-5);
}

.loading-showcase h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
  color: var(--slime-dark);
}

.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skeleton-line {
  height: 20px;
  background: linear-gradient(90deg, var(--lavender-200), var(--lavender-100), var(--lavender-200));
  border-radius: 6px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.full { width: 100%; }

@keyframes pulse {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.skeleton-text {
  height: 16px;
  background: linear-gradient(90deg, var(--lavender-200), var(--lavender-100), var(--lavender-200));
  border-radius: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}

/* === Icon/Emoji Showcase === */
.icon-showcase {
  margin-top: var(--space-5);
}

.icon-showcase h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
  color: var(--slime-dark);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}

.icon-item {
  text-align: center;
  padding: var(--space-3);
  background: var(--card);
  border-radius: var(--demo-radius);
  border: 2px solid var(--ink);
  transition: all var(--transition-normal);
}

.icon-item:hover {
  transform: translateY(-4px);
  box-shadow: 8px 10px 0 var(--slime-dark);
  background: var(--card-hover);
}

.icon-item .icon-emoji {
  font-size: 2rem;
  margin-bottom: var(--space-2);
}

.icon-item .icon-label {
  font-size: var(--step--2);
  color: var(--ink-soft);
}

/* === Typography Utilities === */
.typography-utilities {
  margin-top: var(--space-5);
}

.typography-utilities h4 {
  margin: 0 0 var(--space-3);
  font-size: var(--step-2);
  color: var(--slime-dark);
}

.util-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
}

.util-item {
  text-align: center;
  padding: var(--space-4);
}

.util-label {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-bottom: var(--space-2);
}

.util-sample {
  font-family: var(--slop-font-family);
  color: var(--ink);
}

.util-sample h5 {
  font-size: var(--step-3);
  margin: 0;
  font-family: "Rubik Wet Paint", "Comic Neue", cursive;
  color: var(--slime);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
}

.util-sample h6 {
  font-size: var(--step-2);
  margin: var(--space-1) 0;
  color: var(--slime-dark);
}

/* Responsive adjustments for new sections */
@media (max-width: 600px) {
  .button-showcase {
    grid-template-columns: 1fr;
  }

  .form-examples {
    grid-template-columns: 1fr;
  }

  .color-swatches {
    grid-template-columns: repeat(4, 1fr);
  }

  .icon-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}