:root {
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Global color system */
  --body-bg: #050510;
  --page-bg: #0a0a1a;
  --body-text: #f0f0f5;
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.08);
  --muted-text: rgba(255, 255, 255, 0.5);
  --accent: #6366f1;
  --accent-hover: #818cf8;

  /* Theme-specific colors (can be overridden by individual pages) */
  --surface: rgba(255, 255, 255, 0.06);
  --border: var(--panel-border);
  --text: var(--body-text);
  --muted: var(--muted-text);

  /* Code block colors */
  --code-bg: rgba(0, 0, 0, 0.4);
  --code-text: #e2e8f0;

  /* Animation colors */
  --gradient-purple-blue: linear-gradient(90deg, #6366f1, #22d3ee);
  --gradient-warm: linear-gradient(120deg, #ff6b6b, #ffd166, #1dd3b0);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-bg, var(--body-bg));
  color: var(--text);
  line-height: 1.6;
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

/* Language toggle: default is Japanese (EN hidden until JS or EN button) */
.lang[data-lang="en"] {
  display: none;
}

/* Typography */
h1 {
  margin: 12px 0 8px;
  font-size: 30px;
  color: var(--text);
}

h2 {
  margin-top: 0;
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--text);
}

/* Header component */
header {
  padding: 28px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-bg);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Main layout */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Section cards */
section {
  padding: 24px;
  margin-bottom: 28px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
}

/* Index page specific */
body.index-page {
  background: var(--body-bg);
  color: var(--text);
}

.index-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 16px;
}

.title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.title-group h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.03em;
}

.ai-overview-text {
  margin: 0 0 12px;
  color: var(--muted);
}

/* Language toggle component */
.toggle-lang {
  margin-top: 12px;
  display: flex;
  gap: 12px;
}

.toggle-lang button {
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 4px;
  cursor: pointer;
  transition: border 0.15s ease, background 0.15s ease;
}

.toggle-lang button.active {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

/* Modal components */
.modal,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 16, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.modal.active,
.modal-backdrop.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: min(900px, 100%);
  max-width: 760px;
  background: var(--panel-bg);
  border-radius: 16px;
  padding: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  transform: scale(0.9);
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: relative;
}

.modal.active .modal-content,
.modal-backdrop.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-head h3,
.modal-content h3 {
  margin: 0 0 16px;
  font-size: 24px;
}

.modal-meta {
  font-size: 14px;
  color: var(--muted);
}

.modal iframe {
  width: 100%;
  height: 560px;
  border: none;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
}

/* Section cards specific to index page */
.index-section {
  margin-bottom: 40px;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px;
}

.index-section h2 {
  margin-top: 0;
  font-size: 22px;
  margin-bottom: 12px;
}

/* Pattern page shell (animations/*.html) */
body.pattern-page {
  background: var(--page-bg);
  color: var(--text);
  /* Normalize theme tokens so detail pages share one palette */
  --body-bg: #050510;
  --body-text: #f0f0f5;
  --muted-text: rgba(255, 255, 255, 0.5);
}

.pattern-title {
  letter-spacing: 0.04em;
}

.demo-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}





:root {
  --surface: rgba(255, 255, 255, 0.06);
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.08);
  --border: var(--panel-border);
  --text: var(--body-text);
  --muted: var(--muted-text);
}

body.pattern-page header {
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
}

body.pattern-page section {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
}

body.pattern-page .badge {
  background: var(--surface);
  border: 1px solid var(--panel-border);
  color: var(--text);
}

body.pattern-page .lang-toggle button {
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--text);
}

body.pattern-page .lang-toggle button.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

body.pattern-page .lang-toggle button:hover:not(.active) {
  background: var(--surface);
  border-color: var(--muted);
}

section h2 {
  margin-top: 0;
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--text);
}

/* Badge component */
.badge {
  display: inline-flex;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text);
}

/* Meta information */
.meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

/* Text content */
#ai_description p {
  margin: 0 0 12px;
  color: var(--muted);
}

#parameters ul {
  padding-left: 20px;
  margin: 0;
}

#parameters li {
  margin: 0 0 12px;
  color: var(--muted);
}

/* Code blocks */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
  margin: 16px 0;
}

code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  background: inherit;
  color: inherit;
}

/* Form controls */
.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.control-row label {
  font-weight: 600;
  color: var(--text);
}

.control-row input[type="range"] {
  flex: 1;
  min-width: 200px;
}

/* Common transitions */
.smooth-transition {
  transition: opacity 0.3s ease, transform 0.4s ease;
}

.color-transition {
  transition: background 0.6s ease, color 0.4s ease;
}

/* Language toggle buttons */
.lang-toggle {
  display: inline-flex;
  gap: 10px;
}

.lang-toggle button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  background: var(--panel-bg);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lang-toggle button.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.lang-toggle button:hover:not(.active) {
  border-color: var(--accent);
  background: var(--surface);
}

/* Toggle/pill buttons (for controls) */
.toggle-buttons,
.mood-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-buttons button,
.mood-pills button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  background: var(--panel-bg);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.toggle-buttons button.active,
.mood-pills button.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.toggle-buttons button:hover:not(.active),
.mood-pills button:hover:not(.active) {
  background: var(--surface);
  border-color: var(--muted);
}

/* Interactive button components */
.ripple-button {
  position: relative;
  padding: 12px 24px;
  border: none;
  background: linear-gradient(135deg, #5c6ac4, #22d3ee);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.2s ease;
}

.ripple-button:hover {
  background: linear-gradient(135deg, #4a5ab8, #1bc4d9);
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 3D Flip card components */
.flip-container {
  perspective: 1000px;
  width: 300px;
  height: 200px;
  margin: 0 auto;
  cursor: pointer;
}

.flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
}

.flip-container.flipped .flip-card {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.flip-front {
  background: linear-gradient(135deg, #5c6ac4, #22d3ee);
  color: #fff;
}

.flip-back {
  background: linear-gradient(135deg, #764ba2, #a78bfa);
  color: #fff;
  transform: rotateY(180deg);
}

/* Fade animation components */
.fade-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 40px;
  min-height: 200px;
}

.fade-item {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-item.visible {
  opacity: 1;
  transform: scale(1);
}

.fade-item h4 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--text);
}

.fade-item p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Dropdown navigation components */
.dropdown-item {
  position: relative;
}

.dropdown-trigger {
  border: none;
  background: transparent;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s ease;
}

.dropdown-trigger:hover {
  background: var(--surface);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.dropdown-item:has(.dropdown-menu:not(:empty)) .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s ease;
}

.dropdown-menu a:hover {
  background: var(--surface);
}

/* Loading spinner components */
.spinner {
  width: var(--spinner-size, 48px);
  height: var(--spinner-size, 48px);
  border: 4px solid rgba(92, 106, 196, 0.2);
  border-top-color: var(--spinner-color, #5c6ac4);
  border-radius: 50%;
  animation: spin var(--spinner-speed, 1s) linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Palette preview components */
.palette-preview {
  background: var(--palette-bg);
  border-radius: 20px;
  padding: 40px;
  min-height: 200px;
  transition: background 0.4s ease, color 0.4s ease;
  color: var(--palette-text);
}

.palette-preview h3 {
  margin: 0 0 16px;
  font-size: 28px;
  color: var(--palette-primary);
}

.palette-preview p {
  margin: 0 0 12px;
  color: var(--palette-text);
}

.palette-preview button {
  background: var(--palette-primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.palette-preview button:hover {
  background: var(--palette-secondary);
}

.palette-switcher {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.palette-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  background: var(--panel-bg);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  color: var(--text);
}

.palette-btn.active {
  border-color: var(--palette-primary, #5c6ac4);
  background: var(--palette-primary, #5c6ac4);
  color: #fff;
}

/* Gallery components */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  color: #fff;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-overlay h4 {
  margin: 0;
  font-size: 16px;
}

/* Parallax layout components */
.parallax-container {
  position: relative;
  height: 400px;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.parallax-bg {
  position: absolute;
  inset: -20%;
  background: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?auto=format&fit=crop&w=1200&q=60') center/cover;
  transform: translateY(var(--parallax-offset, 0px));
  will-change: transform;
}

.parallax-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 40px;
}

.parallax-content h3 {
  margin: 0 0 16px;
  font-size: clamp(24px, 4vw, 36px);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.parallax-content p {
  margin: 0;
  font-size: 18px;
  opacity: 0.95;
}

/* Card lift components */
.lift-card {
  background: var(--panel-bg);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.lift-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.lift-card h4 {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--text);
}

.lift-card p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Split hero layout components */
.split-hero {
  --hero-split: 1.2fr 0.8fr;
  display: grid;
  grid-template-columns: var(--hero-split);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.split-hero__copy {
  padding: clamp(24px, 6vw, 56px);
  background: linear-gradient(140deg, #5c6ac4, #22d3ee);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.split-hero__copy span {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.8;
}

.split-hero__copy button {
  align-self: flex-start;
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  font-weight: 600;
  cursor: pointer;
  background: var(--panel-bg);
  color: var(--text);
  transition: background-color 0.2s ease;
}

.split-hero__copy button:hover {
  background: var(--surface);
}

.split-hero__visual {
  background: var(--code-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 40px);
}

.preview-card {
  width: min(320px, 80%);
  border-radius: 20px;
  padding: 18px;
  background: rgba(15, 20, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-card div {
  height: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: var(--spinner-color, #5c6ac4);
  }

  .flip-card {
    transition: none;
  }

  .flip-container.flipped .flip-card {
    transform: rotateY(180deg);
  }

  .parallax-bg {
    transform: none;
  }
}

/* Utility classes */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-16 {
  gap: 16px;
}

.rounded-pill {
  border-radius: 999px;
}

.text-muted {
  color: var(--muted);
}

.font-bold {
  font-weight: 600;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.control-row input[type="range"] {
  flex: 1;
  min-width: 200px;
}

article.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  height: 100%;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

article.card>p.lang {
  min-height: 80px;
  line-height: 1.5;
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

article.card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.15);
  transform: translateY(-4px);
}

.card-preview {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Clickable thumbnail — opens modal */
.card-preview[data-open-modal] {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card-preview[data-open-modal]:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.card-preview.preview-n3 {
  overflow: visible;
}

.card-preview.preview-v2 {
  align-items: flex-start;
}

.card-preview>* {
  width: 100%;
  height: 100%;
}

/* Motion / Visual Previews */
.preview-m1 {
  height: 100%;
  background: #050714;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-m1 .preview-track {
  display: flex;
  gap: 32px;
  width: max-content;
  animation: preview-scroll var(--preview-duration, 10s) linear infinite;
}

.preview-m1 .preview-track span {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  background: linear-gradient(90deg, #7f5af0, #ffa7c4, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes preview-scroll {
  to {
    transform: translateX(-50%);
  }
}

.preview-m2 {
  height: 100%;
  background: radial-gradient(circle at top, rgba(127, 90, 240, 0.4), rgba(5, 7, 20, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.preview-m2 button {
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 999px;
  background: linear-gradient(120deg, #6a5afc, #ff77a9, #20e3b2);
  box-shadow: 0 0 20px rgba(106, 90, 252, 0.6);
  position: relative;
  animation: preview-pulse 2.4s ease-in-out infinite;
}

.preview-m2 button::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  opacity: 0.4;
}

@keyframes preview-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 18px rgba(106, 90, 252, 0.5);
  }

  50% {
    transform: scale(1.04);
    box-shadow: 0 0 32px rgba(255, 119, 169, 0.65);
  }
}

/* Navigation Previews */
.preview-n1 {
  height: 100%;
  background: #f6f7ff;
  padding: 18px 20px 26px;
}

.preview-n1 .tabs {
  position: relative;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 24px;
  height: fit-content;
  --tab-1-left: 0;
  --tab-1-width: 0;
  --tab-2-left: 0;
  --tab-2-width: 0;
  --tab-3-left: 0;
  --tab-3-width: 0;
}

.preview-n1 button {
  background: transparent;
  border: none;
  font-weight: 600;
  color: #39406c;
  padding: 4px 0 10px;
  position: relative;
}

.preview-n1 .highlight {
  position: absolute;
  bottom: 2px;
  height: 3px;
  background: linear-gradient(90deg, #5c6ac4, #8c6ff7);
  border-radius: 999px;
  transform: translateX(-50%);
  animation: preview-underline 5s ease-in-out infinite;
  left: var(--tab-1-left, 0);
  width: var(--tab-1-width, 0);
}

@keyframes preview-underline {
  0% {
    left: var(--tab-1-left, 0);
    width: var(--tab-1-width, 0);
  }

  33% {
    left: var(--tab-2-left, 0);
    width: var(--tab-2-width, 0);
  }

  66% {
    left: var(--tab-3-left, 0);
    width: var(--tab-3-width, 0);
  }

  100% {
    left: var(--tab-1-left, 0);
    width: var(--tab-1-width, 0);
  }
}

.preview-n2 {
  height: 100%;
  background: #0b1024;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 4px;
}

.preview-n2 .stepper-preview {
  width: 100%;
  max-width: 220px;
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.preview-n2 .stepper-dots {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-n2 .stepper-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  position: relative;
}

.preview-n2 .stepper-dot::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5c6ac4, #22d3ee);
  opacity: 0;
  transform: scale(0.6);
}

.preview-n2 .stepper-dot:nth-child(1)::after {
  animation: n2-dot1 4s ease-in-out infinite;
}

.preview-n2 .stepper-dot:nth-child(2)::after {
  animation: n2-dot2 4s ease-in-out infinite;
}

.preview-n2 .stepper-dot:nth-child(3)::after {
  animation: n2-dot3 4s ease-in-out infinite;
}

.preview-n2 .stepper-dot:nth-child(4)::after {
  animation: n2-dot4 4s ease-in-out infinite;
}

@keyframes n2-dot1 {

  0%,
  10% {
    opacity: 0;
    transform: scale(0.6);
  }

  15%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes n2-dot2 {

  0%,
  35% {
    opacity: 0;
    transform: scale(0.6);
  }

  40%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes n2-dot3 {

  0%,
  60% {
    opacity: 0;
    transform: scale(0.6);
  }

  65%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes n2-dot4 {

  0%,
  80% {
    opacity: 0;
    transform: scale(0.6);
  }

  85%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Layout Previews */
.preview-l1 {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #0f1428;
  min-height: 120px;
}

.preview-l1 .hero-left {
  padding: 18px;
  background: linear-gradient(160deg, #3940ff, #2f8fff);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.preview-l1 .hero-left span {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.8;
}

.preview-l1 .hero-left strong {
  font-size: 20px;
}

.preview-l1 .hero-right {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #121635;
}

.preview-l1 .hero-card {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(15, 20, 45, 0.25);
}

.preview-l1 .hero-card div {
  height: 8px;
  background: #e5e7fb;
  border-radius: 6px;
  margin-bottom: 6px;
  animation: preview-card-lines 4s ease-in-out infinite;
}

.preview-l1 .hero-card div:nth-child(2) {
  width: 60%;
}

.preview-l1 .hero-card div:nth-child(3) {
  width: 80%;
}

@keyframes preview-card-lines {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.9;
  }
}

.preview-l2 {
  height: 100%;
  background: #0f1124;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-l2 .card-stack {
  position: relative;
  width: 110px;
  height: 90px;
}

.preview-l2 .stack-card {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(140deg, #1a1f3c, #2a335f);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform-origin: center;
  animation: stackLift 4s ease-in-out infinite;
}

.preview-l2 .stack-card:nth-child(2) {
  transform: translate(10px, -10px);
  animation-delay: 0.2s;
}

.preview-l2 .stack-card:nth-child(3) {
  transform: translate(20px, -20px);
  animation-delay: 0.4s;
  background: linear-gradient(140deg, #5c6ac4, #22d3ee);
}

@keyframes stackLift {

  0%,
  100% {
    box-shadow: 0 6px 12px rgba(5, 8, 25, 0.3);
  }

  50% {
    box-shadow: 0 18px 30px rgba(5, 8, 25, 0.45);
  }
}

/* State / Loading Previews */
.preview-s1 {
  height: 100%;
  background: #111325;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-s1 span {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08));
  animation: skeletonShimmer 1.6s ease-in-out infinite;
}

.preview-s1 span:nth-child(2) {
  width: 80%;
}

.preview-s1 span:nth-child(3) {
  width: 60%;
}

@keyframes skeletonShimmer {
  0% {
    background-position: -60px;
  }

  100% {
    background-position: 120px;
  }
}

.preview-s2 {
  height: 100%;
  background: #050714;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.preview-s2 span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(180deg, #22d3ee, #5c6ac4);
  animation: dotWave 1.2s ease-in-out infinite;
}

.preview-s2 span:nth-child(2) {
  animation-delay: 0.15s;
}

.preview-s2 span:nth-child(3) {
  animation-delay: 0.3s;
}

.preview-s2 span:nth-child(4) {
  animation-delay: 0.45s;
}

.preview-s2 span:nth-child(5) {
  animation-delay: 0.6s;
}

@keyframes dotWave {

  0%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }

  50% {
    transform: translateY(-12px);
    opacity: 1;
  }
}

/* Theme / Behavior Previews */
.preview-t1 {
  height: 100%;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.preview-t1 .theme-preview {
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffd166, #fca311, #4ecdc4);
  animation: preview-day-night 4s ease-in-out infinite;
}

@keyframes preview-day-night {

  0%,
  50% {
    background: linear-gradient(135deg, #ffd166, #fca311, #4ecdc4);
  }

  50.1%,
  100% {
    background: linear-gradient(135deg, #1b1b3a, #274690, #576ca8);
  }
}

.preview-t1 .theme-preview .sun {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe066, #f4a261);
  position: absolute;
  top: 20px;
  left: 20px;
  opacity: 1;
  animation: preview-sun 4s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 224, 102, 0.5);
}

@keyframes preview-sun {

  0%,
  50% {
    opacity: 1;
    transform: scale(1);
  }

  50.1%,
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

.preview-t1 .theme-preview .moon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff, #dfe4ff);
  position: absolute;
  top: 20px;
  right: 20px;
  opacity: 0;
  animation: preview-moon 4s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

@keyframes preview-moon {

  0%,
  50% {
    opacity: 0;
    transform: scale(0.8);
  }

  50.1%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.preview-t1 .theme-preview .info {
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  padding: 12px 24px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  z-index: 1;
  animation: preview-info-color 4s ease-in-out infinite;
}

@keyframes preview-info-color {

  0%,
  50% {
    color: #111;
    background: rgba(255, 255, 255, 0.2);
  }

  50.1%,
  100% {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
  }
}

.preview-t1 .theme-preview .info h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.preview-t2 {
  height: 100%;
  background: #050714;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-t2 .mood {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff6b6b, #ffd166, #1dd3b0, #5c6ac4, #ff6b6b);
  animation: moodSpin 4s linear infinite;
}

@keyframes moodSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Video / Media Previews */
.preview-v1 {
  height: 100%;
  position: relative;
  background: #04060f;
  padding: 0;
  min-height: 120px;
}

.preview-v1 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.preview-v1 .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: rgba(5, 7, 18, 0.4);
}

.preview-v1 .play::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 12px solid #fff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-right: 8px;
}

.preview-v2 {
  height: 100%;
  background: #0b0f24;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.preview-v2 img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.preview-v2 .info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preview-v2 .info small {
  display: block;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.preview-v2 .bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.preview-v2 .bar span {
  display: block;
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #5c6ac4, #22d3ee);
  animation: dockProgress 3s linear infinite;
}

@keyframes dockProgress {
  0% {
    width: 10%;
  }

  100% {
    width: 90%;
  }
}

/* Additional Motion / Visual Previews */
.preview-m3 {
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: center;
}

.preview-m3 .fade-item {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  height: 60px;
  opacity: 0;
  transform: scale(0.85);
  animation: preview-fade-scale 2s ease-in-out infinite;
}

.preview-m3 .fade-item:nth-child(2) {
  animation-delay: 0.2s;
}

.preview-m3 .fade-item:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes preview-fade-scale {

  0%,
  100% {
    opacity: 0;
    transform: scale(0.85);
  }

  20%,
  80% {
    opacity: 1;
    transform: scale(1);
  }
}

.preview-m4 {
  height: 100%;
  background: #f5f7ff;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-m4 .lift-card {
  width: 80%;
  height: 60%;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  animation: preview-lift 2s ease-in-out infinite;
}

@keyframes preview-lift {

  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  50% {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  }
}

/* Additional Navigation Previews */
.preview-n3 {
  height: 100%;
  background: #ffffff;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

.preview-n3 .dropdown-nav-thumbnail {
  position: relative;
  display: inline-flex;
  gap: 6px;
  background: #f9fafb;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 4px 6px;
  margin: 0;
  height: fit-content;
}

.preview-n3 button {
  padding: 4px 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}

.preview-n3 .dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #ffffff;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px;
  min-width: 100px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: preview-dropdown 2.5s ease-in-out infinite;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

@keyframes preview-dropdown {

  0%,
  30% {
    opacity: 0;
    transform: translateY(-10px);
  }

  40%,
  80% {
    opacity: 1;
    transform: translateY(0);
  }

  90%,
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.preview-n3 .dropdown-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}

/* Additional Layout Previews */
.preview-l3 {
  height: 100%;
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
}

.preview-l3 .parallax-bg {
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?auto=format&fit=crop&w=400&q=60') center/cover;
  opacity: 0.6;
  animation: preview-parallax 4s ease-in-out infinite;
}

@keyframes preview-parallax {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

.preview-l3 .parallax-content {
  position: relative;
  z-index: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Additional State / Loading Previews */
.preview-s3 {
  height: 100%;
  background: linear-gradient(135deg, #f5f7ff 0%, #e8ebff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-s3 .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(92, 106, 196, 0.2);
  border-top-color: #5c6ac4;
  border-radius: 50%;
  animation: preview-spin 1s linear infinite;
}

@keyframes preview-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Additional Theme / Behavior Previews */
.preview-t3 {
  height: 100%;
  background: linear-gradient(135deg, #5c6ac4, #22d3ee);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.preview-t3 .palette-preview {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: preview-palette 3s ease-in-out infinite;
}

@keyframes preview-palette {
  0% {
    background: rgba(92, 106, 196, 0.95);
  }

  33% {
    background: rgba(34, 211, 238, 0.95);
  }

  66% {
    background: rgba(118, 75, 162, 0.95);
  }

  100% {
    background: rgba(92, 106, 196, 0.95);
  }
}

.preview-t3 h4 {
  margin: 0;
  font-size: 16px;
  color: #fff;
  font-weight: 600;
}

/* Additional Video / Media Previews */
.preview-v3 {
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.preview-v3 {
  display: flex;
  overflow: hidden;
}

.preview-v3 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: preview-gallery-slide 4s ease-in-out infinite;
}

@keyframes preview-gallery-slide {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.preview-v3 .gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  animation: preview-gallery-overlay 4s ease-in-out infinite;
}

@keyframes preview-gallery-overlay {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.preview-v3 .gallery-overlay h4 {
  margin: 0;
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}

/* Interaction Previews */
.preview-i1 {
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-i1 .modal-content {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  max-width: 200px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: preview-modal 3s ease-in-out infinite;
  transform-origin: center;
}

@keyframes preview-modal {

  0%,
  40% {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }

  50%,
  90% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  100% {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }
}

.preview-i1 h4 {
  margin: 0;
  font-size: 16px;
  color: var(--text);
}

.preview-i2 {
  height: 100%;
  background: linear-gradient(135deg, #5c6ac4, #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-i2 .ripple-button {
  position: relative;
  padding: 10px 20px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
}

.preview-i2 .ripple-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  animation: preview-ripple 2s ease-out infinite;
}

@keyframes preview-ripple {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }

  100% {
    width: 200px;
    height: 200px;
    opacity: 0;
  }
}

.preview-i3 {
  height: 100%;
  background: #f5f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  perspective: 600px;
}

.preview-i3 .flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: preview-flip 3s ease-in-out infinite;
}

@keyframes preview-flip {

  0%,
  45% {
    transform: rotateY(0deg);
  }

  50%,
  95% {
    transform: rotateY(180deg);
  }

  100% {
    transform: rotateY(360deg);
  }
}

.preview-i3 .flip-front {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #5c6ac4, #22d3ee);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  backface-visibility: hidden;
}

.preview-i3 .flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #764ba2, #a78bfa);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  backface-visibility: hidden;
  transform: rotateY(180deg);
}

.preview-i3 .flip-container {
  width: 100%;
  height: 100%;
}

/* Additional Motion Previews */
.preview-m5 {
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-m5 .text-reveal-preview {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.preview-m5 .reveal-word {
  display: inline-block;
  overflow: hidden;
  margin: 0 0.1em;
  vertical-align: bottom;
}

.preview-m5 .reveal-word span {
  display: inline-block;
  transform: translateY(50px);
  opacity: 0;
  animation: preview-slide-reveal 3s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.preview-m5 .reveal-word:nth-child(1) span {
  animation-delay: 0s;
}

.preview-m5 .reveal-word:nth-child(2) span {
  animation-delay: 0.2s;
}

.preview-m5 .reveal-word:nth-child(3) span {
  animation-delay: 0.4s;
}

@keyframes preview-slide-reveal {
  0% {
    transform: translateY(50px);
    opacity: 0;
  }

  25%,
  75% {
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    transform: translateY(-50px);
    opacity: 0;
  }
}

.preview-m6 {
  height: 100%;
  background: #050714;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.preview-m6 .particle-preview {
  position: relative;
  width: 100%;
  height: 100%;
}

.preview-m6 .particle-preview span {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: preview-particle-float 3s ease-in-out infinite;
}

.preview-m6 .particle-preview span:nth-child(1) {
  left: 25%;
  top: 70%;
  animation-delay: 0s;
}

.preview-m6 .particle-preview span:nth-child(2) {
  left: 75%;
  top: 30%;
  animation-delay: 0.6s;
}

.preview-m6 .particle-preview span:nth-child(3) {
  left: 45%;
  top: 50%;
  animation-delay: 1.2s;
}

.preview-m6 .particle-preview span:nth-child(4) {
  left: 80%;
  top: 80%;
  animation-delay: 1.8s;
}

.preview-m6 .particle-preview span:nth-child(5) {
  left: 15%;
  top: 20%;
  animation-delay: 2.4s;
}

@keyframes preview-particle-float {
  0% {
    transform: translateY(30px) translateX(0);
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  75% {
    opacity: 1;
  }

  100% {
    transform: translateY(-30px) translateX(20px);
    opacity: 0;
  }
}

/* Additional Navigation Previews */
.preview-n4 {
  height: 100%;
  background: #f5f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-n4 .breadcrumb-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #5c6184;
}

.preview-n4 .breadcrumb-preview span {
  transition: color 0.3s ease;
}

.preview-n4 .breadcrumb-preview span:not(:last-child) {
  animation: preview-breadcrumb-hover 3s ease-in-out infinite;
}

.preview-n4 .breadcrumb-preview span:last-child {
  color: #1d2242;
  font-weight: 600;
}

@keyframes preview-breadcrumb-hover {

  0%,
  80% {
    color: #5c6184;
  }

  85%,
  95% {
    color: #5c6ac4;
  }

  100% {
    color: #5c6184;
  }
}

.preview-n5 {
  height: 100%;
  background: #f5f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-n5 .pagination-preview {
  display: flex;
  gap: 6px;
  align-items: center;
}

.preview-n5 .pagination-preview span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #1d2242;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.preview-n5 .pagination-preview span.active {
  background: #5c6ac4;
  color: #fff;
  border-color: #5c6ac4;
}

.preview-n5 .pagination-preview span:not(.active):hover {
  background: rgba(92, 106, 196, 0.1);
  border-color: rgba(92, 106, 196, 0.3);
}

/* 前ボタン（1番目）は常に無効化状態 */
.preview-n5 .pagination-preview span:nth-child(1) {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* ページ番号1（2番目）は最初アクティブ、その後非アクティブ */
.preview-n5 .pagination-preview span:nth-child(2) {
  animation: preview-pagination-active 4.5s ease-in-out infinite;
  animation-delay: 0s;
}

/* ページ番号2（3番目）が次にアクティブ */
.preview-n5 .pagination-preview span:nth-child(3) {
  animation: preview-pagination-active 4.5s ease-in-out infinite;
  animation-delay: 1.5s;
}

/* ページ番号3（4番目）がその次にアクティブ */
.preview-n5 .pagination-preview span:nth-child(4) {
  animation: preview-pagination-active 4.5s ease-in-out infinite;
  animation-delay: 3s;
}

/* 後ボタン（5番目）は通常有効（ホバーエフェクトのみ） */


@keyframes preview-pagination-active {

  0%,
  20% {
    background: transparent;
    color: #1d2242;
    border-color: transparent;
  }

  25%,
  35% {
    background: #5c6ac4;
    color: #fff;
    border-color: #5c6ac4;
  }

  40%,
  100% {
    background: transparent;
    color: #1d2242;
    border-color: transparent;
  }
}

/* Additional State / Loading Previews */
.preview-s4 {
  height: 100%;
  background: #0b0d1f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-s4 .progress-preview {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-s4 .progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.preview-s4 .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #5c6ac4, #22d3ee);
  background-image: linear-gradient(90deg,
      #5c6ac4,
      #22d3ee,
      rgba(255, 255, 255, 0.3),
      #22d3ee,
      #5c6ac4);
  background-size: 200% 100%;
  border-radius: inherit;
  animation: preview-progress-fill 3s ease-in-out infinite,
    preview-progress-shimmer 2s ease-in-out infinite;
}

@keyframes preview-progress-fill {

  0%,
  20% {
    width: 0%;
  }

  50% {
    width: 75%;
  }

  80%,
  100% {
    width: 0%;
  }
}

@keyframes preview-progress-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.preview-s5 {
  height: 100%;
  background: #0b0d1f;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-s5 .skeleton-card-preview {
  width: 100%;
  max-width: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-s5 .skeleton-image {
  width: 100%;
  height: 80px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  background-size: 200% 100%;
  border-radius: 6px;
  margin-bottom: 10px;
  animation: preview-shimmer 1.6s ease-in-out infinite;
}

.preview-s5 .skeleton-title {
  height: 12px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  background-size: 200% 100%;
  border-radius: 4px;
  margin-bottom: 8px;
  width: 70%;
  animation: preview-shimmer 1.6s ease-in-out infinite;
  animation-delay: 0.1s;
}

.preview-s5 .skeleton-text {
  height: 10px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
  background-size: 200% 100%;
  border-radius: 4px;
  width: 90%;
  animation: preview-shimmer 1.6s ease-in-out infinite;
  animation-delay: 0.2s;
}

@keyframes preview-shimmer {
  0% {
    background-position: -120%;
  }

  100% {
    background-position: 120%;
  }
}

/* Additional Layout Previews */
.preview-l4 {
  height: 100%;
  background: #0b0d1f;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-l4 .masonry-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 180px;
}

.preview-l4 .masonry-preview div {
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #1d2242;
}

.preview-l4 .masonry-preview div:nth-child(1) {
  height: 40px;
  animation: preview-masonry-height 3s ease-in-out infinite;
}

.preview-l4 .masonry-preview div:nth-child(2) {
  height: 60px;
  animation: preview-masonry-height 3s ease-in-out infinite;
  animation-delay: 0.5s;
}

.preview-l4 .masonry-preview div:nth-child(3) {
  height: 50px;
  animation: preview-masonry-height 3s ease-in-out infinite;
  animation-delay: 1s;
}

.preview-l4 .masonry-preview div:nth-child(4) {
  height: 45px;
  animation: preview-masonry-height 3s ease-in-out infinite;
  animation-delay: 1.5s;
}

@keyframes preview-masonry-height {

  0%,
  30% {
    height: 30px;
  }

  50% {
    height: 60px;
  }

  70%,
  100% {
    height: 30px;
  }
}

.preview-l5 {
  height: 100%;
  background: linear-gradient(180deg, #f5f7ff, #e8ebff);
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.preview-l5 .sticky-header-preview {
  width: 100%;
  height: 100%;
  position: relative;
}

.preview-l5 .header-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: rgba(245, 247, 255, 0.6);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #dfe3f6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  z-index: 10;
  animation: preview-sticky-header-scroll 3s ease-in-out infinite;
}

.preview-l5 .content-area {
  position: absolute;
  top: 32px;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(245, 247, 255, 0.3), rgba(232, 235, 255, 0.3));
  animation: preview-content-scroll 3s ease-in-out infinite;
}

.preview-l5 .content-area::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 15px,
      rgba(92, 106, 196, 0.05) 15px,
      rgba(92, 106, 196, 0.05) 17px);
  animation: preview-content-scroll 3s ease-in-out infinite;
}

@keyframes preview-sticky-header-scroll {

  0%,
  25% {
    background: rgba(245, 247, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-bottom-color: #dfe3f6;
  }

  50% {
    background: rgba(245, 247, 255, 0.95);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-bottom-color: #dfe3f6;
  }

  75%,
  100% {
    background: rgba(245, 247, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-bottom-color: #dfe3f6;
  }
}

@keyframes preview-content-scroll {

  0%,
  25% {
    transform: translateY(0);
    opacity: 0.7;
  }

  50% {
    transform: translateY(-15px);
    opacity: 0.9;
  }

  75%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
}

/* Additional Interaction Previews */
.preview-i4 {
  height: 100%;
  background: #0b0d1f;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-i4 .tooltip-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-i4 .tooltip-trigger {
  padding: 8px 16px;
  background: rgba(92, 106, 196, 0.2);
  border: 1px solid rgba(92, 106, 196, 0.4);
  border-radius: 6px;
  color: #f5f6ff;
  font-size: 12px;
  cursor: pointer;
}

.preview-i4 .tooltip-bubble {
  position: absolute;
  bottom: calc(65% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: #1a1d3a;
  color: #f5f6ff;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  animation: preview-tooltip-show 3s ease-in-out infinite;
}

.preview-i4 .tooltip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-top-color: #1a1d3a;
}

@keyframes preview-tooltip-show {

  0%,
  60% {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }

  70%,
  90% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(4px);
  }
}

.preview-i5 {
  height: 100%;
  background: linear-gradient(135deg, #ff6b9d, #c44569, #a29bfe, #6c5ce7, #ffffff);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.preview-i5::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle, rgba(92, 106, 196, 0.5) 25px, transparent 25px),
    linear-gradient(45deg, rgba(34, 211, 238, 0.5) 30px, transparent 30px);
  background-size:
    120px 120px,
    100px 100px;
  background-position:
    20% 30%,
    75% 60%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}

.preview-i5::after {
  content: "▶";
  position: absolute;
  font-size: 60px;
  color: rgba(34, 211, 238, 0.4);
  top: 15%;
  right: 20%;
  pointer-events: none;
  z-index: 0;
}

.preview-i5>* {
  position: relative;
  z-index: 1;
}

.preview-i5 .accordion-preview {
  width: 100%;
  max-width: 200px;
}

.preview-i5 .accordion-item {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  border-bottom: 5px solid rgba(92, 106, 196, 0.2);
  overflow: hidden;
  margin-bottom: 8px;
}

.preview-i5 .accordion-header {
  padding: 10px 12px;
  color: #1d2242;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-i5 .accordion-header::after {
  content: "+";
  font-size: 16px;
  color: #5c6ac4;
  font-weight: 300;
  animation: preview-accordion-icon 2s ease-in-out infinite;
}

@keyframes preview-accordion-icon {

  0%,
  40% {
    transform: rotate(0deg);
  }

  50%,
  90% {
    transform: rotate(45deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.preview-i5 .accordion-content {
  height: 30px;
  background: rgba(255, 255, 255, 0.2);
  animation: preview-accordion-expand 2s ease-in-out infinite;
}

@keyframes preview-accordion-expand {

  0%,
  40% {
    height: 0;
    opacity: 0;
  }

  50%,
  90% {
    height: 30px;
    opacity: 1;
  }

  100% {
    height: 0;
    opacity: 0;
  }
}

/* M-8 Shake / Bounce */
.preview-m8 {
  height: 100%;
  background: #f5f7ff;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.preview-m8 .feedback-shake-preview {
  width: 60px;
  height: 36px;
  background: #fef2f2;
  border-radius: 8px;
  border: 2px solid #fecaca;
  animation: preview-shake 2.5s ease-in-out infinite;
}

.preview-m8 .feedback-bounce-preview {
  width: 60px;
  height: 36px;
  background: #f0fdf4;
  border-radius: 8px;
  border: 2px solid #bbf7d0;
  animation: preview-bounce-in 2.5s ease-in-out infinite;
}

@keyframes preview-shake {

  0%,
  35%,
  100% {
    transform: translateX(0);
  }

  40%,
  50%,
  60% {
    transform: translateX(-4px);
  }

  45%,
  55% {
    transform: translateX(4px);
  }
}

@keyframes preview-bounce-in {

  0%,
  35%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  65% {
    transform: scale(0.95);
  }

  80% {
    transform: scale(1);
  }
}

/* S-6 Toast */
.preview-s6 {
  height: 100%;
  background: #f5f7ff;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  position: relative;
}

.preview-s6 .toast-preview {
  padding: 10px 16px;
  background: #1d2242;
  color: #f5f6ff;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: preview-toast-slide 3s ease-in-out infinite;
}

@keyframes preview-toast-slide {

  0%,
  25% {
    transform: translateX(120%);
    opacity: 0;
  }

  35%,
  65% {
    transform: translateX(0);
    opacity: 1;
  }

  75%,
  100% {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* N-6 Back to Top */
.preview-n6 {
  height: 100%;
  background: linear-gradient(180deg, #e8ebff 0%, #f5f7ff 100%);
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.preview-n6 .backtotop-preview-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #5c6ac4;
  color: #fff;
  border: none;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(92, 106, 196, 0.4);
  animation: preview-backtotop-pulse 2s ease-in-out infinite;
}

@keyframes preview-backtotop-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}

/* V-4 Image Zoom */
.preview-v4 {
  height: 100%;
  background: #1d2242;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-v4 .zoom-preview-wrap {
  position: relative;
  width: 80%;
  height: 70%;
  min-height: 40px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}

.preview-v4 .zoom-preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: preview-zoom-in-v4 2.5s ease-in-out infinite;
}

@keyframes preview-zoom-in-v4 {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
  }
}

/* M-9 Icon Hover Spin */
.preview-m9 {
  height: 100%;
  background: #f5f7ff;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-m9 .icon-spin-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  font-size: 32px;
  transform-origin: center center;
  animation: preview-icon-spin 2s ease-in-out infinite;
}

@keyframes preview-icon-spin {

  0%,
  100% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(180deg);
  }
}

/* I-6 Toggle Switch */
.preview-i6 {
  height: 100%;
  background: #f5f7ff;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-i6 .toggle-preview {
  width: 52px;
  height: 28px;
  background: #5c6ac4;
  border-radius: 999px;
  position: relative;
}

.preview-i6 .toggle-preview::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  animation: preview-toggle-knob 2.5s ease-in-out infinite;
}

@keyframes preview-toggle-knob {

  0%,
  40% {
    transform: translateX(0);
  }

  50%,
  90% {
    transform: translateX(24px);
  }

  100% {
    transform: translateX(0);
  }
}

/* T-4 Dark Mode Toggle */
.preview-t4 {
  height: 100%;
  background: #f5f7ff;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-t4 .theme-preview-swatch {
  width: 60%;
  height: 50%;
  border-radius: 12px;
  background: #1d2242;
  animation: preview-theme-pulse 3s ease-in-out infinite;
}

@keyframes preview-theme-pulse {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }
}

/* S-7 Overlay Loader */
.preview-s7 {
  height: 100%;
  background: #1d2242;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.preview-s7 .overlay-preview-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: overlay-spin-preview 0.8s linear infinite;
}

@keyframes overlay-spin-preview {
  to {
    transform: rotate(360deg);
  }
}

/* N-7 Floating Action Button */
.preview-n7 {
  height: 100%;
  background: #f5f7ff;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.preview-n7 .fab-preview-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #5c6ac4;
  color: #fff;
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(92, 106, 196, 0.4);
  animation: preview-fab-pulse 2s ease-in-out infinite;
}

@keyframes preview-fab-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.filter-bar select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f0f0f5' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  /* ネイティブドロップダウンをダークモードで描画させる */
  color-scheme: dark;
}

.filter-bar select option {
  background-color: #1e1e2e;
  color: #f0f0f5;
}

.filter-bar select:hover,
.filter-bar select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}

.filter-count {
  font-size: 13px;
  color: var(--muted-text);
  margin-left: auto;
}

.filter-count strong {
  font-weight: 600;
  color: var(--text);
}

/* Card Grid Layout */
#pattern_list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card-id {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted-text);
  letter-spacing: 0.04em;
}

.card-title {
  margin: 0;
  font-size: 20px;
}

.card-category {
  font-size: 13px;
  color: var(--muted-text);
  margin: 0;
}

.card-actions {
  display: flex;
  gap: 10px;
}

/* Single-action state: detail link takes full width */
.card-actions:has(> a:only-child) a,
.card-actions a:only-child {
  flex: none;
  width: 100%;
}

.card-actions button,
.card-actions a {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  font-weight: 500;
}

.card-actions a {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.card-actions a:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
}

.card-actions button {
  border-color: var(--panel-border);
  color: var(--text);
  background: var(--panel-bg);
}

.card-actions button:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--surface);
}

.card-actions button .lang,
.card-actions a .lang {
  display: inline;
}

@media (max-width: 768px) {

  .index-header,
  header,
  main {
    padding: 20px 16px;
  }

  .index-section,
  section {
    padding: 18px;
  }

  .modal-content {
    margin: 16px;
    width: calc(100% - 32px);
  }

  .modal iframe {
    height: 320px;
  }

  .split-hero {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   New Pattern Previews (Phase 2 & 3)
   ========================================= */


/* --- F: Form / Input --- */
.preview-f1,
.preview-f2,
.preview-f3,
.preview-f4,
.preview-f5 {
  height: 100%;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* F-1: Floating Label */
.preview-f1 .input-mock {
  position: relative;
  width: 100%;
  max-width: 180px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
}

.preview-f1 .input-mock::after {
  content: "Label";
  position: absolute;
  top: -8px;
  left: 8px;
  background: #fff;
  padding: 0 4px;
  font-size: 10px;
  color: var(--accent);
  animation: preview-float-label 3s ease-in-out infinite;
}

@keyframes preview-float-label {

  0%,
  10% {
    top: 12px;
    font-size: 12px;
    color: var(--muted);
  }

  40%,
  60% {
    top: -8px;
    font-size: 10px;
    color: var(--accent);
  }

  90%,
  100% {
    top: 12px;
    font-size: 12px;
    color: var(--muted);
  }
}

/* F-4: Validation */
.preview-f4 {
  justify-content: center;
  align-items: center;
}

.preview-f4 .validation-mock {
  width: 100%;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-f4 .input-error {
  height: 36px;
  border: 2px solid #ef4444;
  border-radius: 6px;
  background: #fef2f2;
  animation: preview-input-shake 4s ease-in-out infinite;
}


/* F-2: Custom Select */
.preview-f2 {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}

.select-mock {
  width: 120px;
  height: 36px;
  background: #fff;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  color: #64748b;
  position: relative;
  font-family: inherit;
  animation: preview-select-toggle 3s ease-in-out infinite;
}

.select-mock::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 13px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #94a3b8;
}

.select-mock::before {
  content: "";
  position: absolute;
  top: 100%;
  left: -2px;
  right: -2px;
  height: 0;
  background: #fff;
  border: 2px solid #5c6ac4;
  border-top: none;
  border-radius: 0 0 8px 8px;
  opacity: 0;
  z-index: 5;
  animation: preview-select-dropdown 3s ease-in-out infinite;
}

@keyframes preview-select-toggle {

  0%,
  45% {
    border-radius: 8px;
    border-color: #cbd5e1;
  }

  50%,
  95% {
    border-radius: 8px 8px 0 0;
    border-color: #5c6ac4;
  }
}

@keyframes preview-select-dropdown {

  0%,
  45% {
    height: 0;
    opacity: 0;
    border-width: 0;
  }

  50%,
  95% {
    height: 60px;
    opacity: 1;
    border-width: 2px;
  }
}

/* F-3: Checkbox & Radio */
.preview-f3 {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}

.preview-f3 .toggle-group {
  display: flex;
  gap: 20px;
  align-items: center;
}

.preview-f3 .cb-mock {
  width: 28px;
  height: 28px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: f3-cb-toggle 3s ease-in-out infinite;
}

.preview-f3 .cb-mock svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: f3-check-draw 3s ease-in-out infinite;
}

.preview-f3 .rd-mock {
  width: 28px;
  height: 28px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: f3-rd-border 3s ease-in-out infinite;
  animation-delay: 0.3s;
}

.preview-f3 .rd-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #5c6ac4;
  transform: scale(0);
  animation: f3-rd-fill 3s ease-in-out infinite;
  animation-delay: 0.3s;
}

@keyframes f3-cb-toggle {

  0%,
  40% {
    background: #fff;
    border-color: #cbd5e1;
    transform: scale(1);
  }

  45% {
    transform: scale(1.15);
  }

  50%,
  90% {
    background: #5c6ac4;
    border-color: #5c6ac4;
    transform: scale(1);
  }

  95% {
    transform: scale(1);
  }
}

@keyframes f3-check-draw {

  0%,
  42% {
    stroke-dashoffset: 20;
  }

  55%,
  90% {
    stroke-dashoffset: 0;
  }

  95%,
  100% {
    stroke-dashoffset: 20;
  }
}

@keyframes f3-rd-border {

  0%,
  40% {
    border-color: #cbd5e1;
  }

  50%,
  90% {
    border-color: #5c6ac4;
  }
}

@keyframes f3-rd-fill {

  0%,
  40% {
    transform: scale(0);
  }

  45% {
    transform: scale(1.15);
  }

  50%,
  90% {
    transform: scale(1);
  }

  95%,
  100% {
    transform: scale(0);
  }
}

.preview-f4 .msg-error {
  color: #ef4444;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 1;
  animation: preview-error-fade 4s ease-in-out infinite;
}

.preview-f4 .msg-error::before {
  content: "!";
  display: inline-flex;
  width: 12px;
  height: 12px;
  background: #ef4444;
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  justify-content: center;
  align-items: center;
}

@keyframes preview-input-shake {

  0%,
  80% {
    transform: translateX(0);
    border-color: #d1d5db;
    background: #fff;
  }

  82%,
  98% {
    transform: translateX(0);
    border-color: #ef4444;
    background: #fef2f2;
  }

  84%,
  96% {
    transform: translateX(-2px);
  }

  86%,
  94% {
    transform: translateX(2px);
  }

  88%,
  92% {
    transform: translateX(-1px);
  }

  90% {
    transform: translateX(1px);
  }

  100% {
    transform: translateX(0);
    border-color: #d1d5db;
    background: #fff;
  }
}

@keyframes preview-error-fade {

  0%,
  80% {
    opacity: 0;
    transform: translateY(-5px);
  }

  85%,
  95% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-5px);
  }
}

/* F-5: Search Suggestions */
.preview-f5 .search-mock {
  width: 100%;
  max-width: 180px;
  position: relative;
}

.preview-f5 .search-bar {
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  background: #fff;
  font-size: 12px;
  color: var(--muted);
}

.preview-f5 .search-bar::before {
  content: "🔍";
  margin-right: 6px;
}

.preview-f5 .suggestions {
  position: absolute;
  top: 40px;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(-5px);
  animation: preview-suggestions-show 3s ease-in-out infinite;
}

.preview-f5 .suggestions span {
  height: 6px;
  background: #f3f4f6;
  border-radius: 2px;
  width: 80%;
}

.preview-f5 .suggestions span:nth-child(2) {
  width: 60%;
}

@keyframes preview-suggestions-show {

  0%,
  20% {
    opacity: 0;
    transform: translateY(-5px);
    visibility: hidden;
  }

  30%,
  80% {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }

  90%,
  100% {
    opacity: 0;
    transform: translateY(-5px);
    visibility: hidden;
  }
}

/* --- M: Motion / Visual (Additions) --- */

/* M-7: Underline Grow Link */
.preview-m7 {
  background: #f5f7ff;
}

.preview-m7-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  height: 100%;
}

.preview-m7 .underline-link-preview {
  position: relative;
  text-decoration: none;
  color: #1d2242;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
}

.preview-m7 .underline-link-preview::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: #5c6ac4;
  animation: preview-underline-grow 3s ease-in-out infinite;
}

.preview-m7 .underline-link-preview:nth-child(2)::after {
  animation-delay: 1s;
}

.preview-m7 .underline-link-preview:nth-child(3)::after {
  animation-delay: 2s;
}

@keyframes preview-underline-grow {

  0%,
  20% {
    width: 0;
    left: 50%;
  }

  30%,
  40% {
    width: 100%;
    left: 0;
  }

  50%,
  100% {
    width: 0;
    left: 50%;
  }
}

/* M-10: Typewriter (Improved) */
.preview-m10 {
  height: 100%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f0;
  font-family: monospace;
  font-size: 16px;
}

.preview-m10 .typewriter-text {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid #0f0;
  width: 0;
  display: inline-block;
  line-height: 1;
  height: 1em;
  padding-right: 2px;
  animation:
    typing 3.5s steps(15, end) infinite,
    blink-caret .75s step-end infinite;
}

@keyframes typing {
  0% {
    width: 0;
  }

  50%,
  90% {
    width: 13ch;
  }

  /* "Typewriter..." is approx 13ch */
  100% {
    width: 0;
  }
}

@keyframes blink-caret {

  from,
  to {
    border-color: transparent;
  }

  50% {
    border-color: #0f0;
  }
}

/* M-11: Count Up (Improved) */
.preview-m11 {
  height: 100%;
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.preview-m11 .counter {
  width: fit-content;
  height: fit-content;
}

.preview-m11 .counter::after {
  content: "10000";
  animation: countUpSmooth 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes countUpSmooth {
  0% {
    content: "0";
    filter: blur(4px);
  }

  20% {
    content: "241";
    filter: blur(2px);
  }

  40% {
    content: "5892";
    filter: blur(2px);
  }

  60% {
    content: "8245";
    filter: blur(1px);
  }

  80% {
    content: "9980";
    filter: blur(0px);
  }

  100% {
    content: "10000";
    filter: blur(0);
  }
}

/* M-12: Scroll Reveal (Existing) */
.preview-m12 {
  height: 100%;
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.preview-m12 .reveal-block {
  width: 60px;
  height: 60px;
  background: #cbd5e1;
  border-radius: 8px;
}

.preview-m12 .reveal-block.active {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  animation: slideUpFade 2s infinite;
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  50%,
  80% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* --- L: Layout (Additions) --- */

/* L-6: Footer */
.preview-l6 {
  height: 100%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.preview-l6 .window-mock {
  height: 90%;
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  animation: l6-window-resize 8s ease-in-out infinite;
}

.preview-l6 .window-bar {
  height: 10px;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  flex-shrink: 0;
}

.preview-l6 .window-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d1d5db;
}

.preview-l6 .window-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.preview-l6 .page-content {
  flex: 1;
  background: #f9fafb;
}

.preview-l6 .footer-mock {
  background: #1f2937;
  padding: 6px 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.preview-l6 .footer-cols {
  display: flex;
  gap: 6px;
  animation: l6-cols-layout 8s ease-in-out infinite;
}

.preview-l6 .footer-col-mock {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.preview-l6 .col-title {
  height: 3px;
  background: #d1d5db;
  border-radius: 1px;
  width: 65%;
}

.preview-l6 .col-link {
  height: 2px;
  background: #4b5563;
  border-radius: 1px;
  width: 80%;
}

.preview-l6 .footer-bottom-mock {
  border-top: 1px solid #374151;
  padding-top: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-l6 .copyright-mock {
  width: 40%;
  height: 2px;
  background: #4b5563;
  border-radius: 1px;
}

.preview-l6 .social-mock {
  display: flex;
  gap: 3px;
}

.preview-l6 .social-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4b5563;
}

/* PC → Tablet → Smartphone → back */
@keyframes l6-window-resize {

  0%,
  10% {
    width: 95%;
  }

  25%,
  40% {
    width: 65%;
  }

  55%,
  70% {
    width: 38%;
  }

  85%,
  100% {
    width: 95%;
  }
}

@keyframes l6-cols-layout {

  0%,
  10% {
    flex-direction: row;
    gap: 6px;
  }

  25%,
  40% {
    flex-direction: row;
    gap: 4px;
  }

  55%,
  70% {
    flex-direction: column;
    gap: 2px;
  }

  85%,
  100% {
    flex-direction: row;
    gap: 6px;
  }
}

/* L-7: Pricing */
.preview-l7 {
  height: 100%;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
}

.preview-l7 .price-card {
  flex: 1;
  height: 80px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  transition: all 0.3s;
}

.preview-l7 .price-card.featured {
  height: 90px;
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
  animation: preview-pricing-pulse 2s ease-in-out infinite;
}

.preview-l7 .line {
  width: 80%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
}

@keyframes preview-pricing-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.1);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2);
  }
}

/* L-8: CTA Banner */
.preview-l8 {
  height: 100%;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.preview-l8 .cta-mock {
  width: 100%;
  height: 90%;
  background: linear-gradient(135deg, #1d2242, #3a4276);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.preview-l8 .cta-mock::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 10px 10px;
  opacity: 0.15;
}

.preview-l8 .cta-title-mock {
  width: 55%;
  height: 6px;
  background: #fff;
  border-radius: 3px;
  position: relative;
  z-index: 1;
}

.preview-l8 .cta-text-mock {
  width: 70%;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
  position: relative;
  z-index: 1;
}

.preview-l8 .cta-btn-mock {
  margin-top: 4px;
  width: 40%;
  height: 14px;
  background: #fff;
  border-radius: 10px;
  position: relative;
  z-index: 1;
  animation: preview-cta-btn-pulse 2.5s ease-in-out infinite;
}

@keyframes preview-cta-btn-pulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

/* --- N: Navigation (Additions) --- */

/* N-8: Sidebar */
.preview-n8 {
  height: 100%;
  background: #f3f4f6;
  display: flex;
  overflow: hidden;
}

.preview-n8 .sidebar-mock {
  width: 60px;
  height: 100%;
  background: #1f2937;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: preview-sidebar-toggle 4s ease-in-out infinite;
}

.preview-n8 .menu-item {
  width: 100%;
  height: 6px;
  background: #374151;
  border-radius: 3px;
}

.preview-n8 .menu-item.active {
  background: #60a5fa;
  width: 70%;
}

.preview-n8 .content-mock {
  flex: 1;
  padding: 12px;
  background: linear-gradient(white, #f3f4f6);
}

@keyframes preview-sidebar-toggle {

  0%,
  10%,
  90%,
  100% {
    width: 40px;
  }

  40%,
  60% {
    width: 100px;
  }
}

/* N-9: Hamburger */
.preview-n9 {
  height: 100%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-n9 .mobile-mock {
  width: 100px;
  height: 160px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.preview-n9 .header-mock {
  height: 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  position: relative;
  z-index: 20;
  background: #fff;
}

.preview-n9 .logo-mock {
  width: 20px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
}

.preview-n9 .hamburger {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 14px;
  cursor: pointer;
}

.preview-n9 .hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #1f2937;
  border-radius: 2px;
  position: relative;
  transition: 0.3s;
}

/* Menu Overlay */
.preview-n9 .menu-overlay {
  position: absolute;
  top: 24px;
  left: 0;
  width: 100%;
  height: calc(100% - 24px);
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateY(-100%);
  animation: preview-menu-slide 3s ease-in-out infinite;
  z-index: 10;
}

.preview-n9 .menu-line {
  width: 60%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  opacity: 0;
  animation: preview-menu-items 3s ease-in-out infinite;
}

@keyframes preview-menu-slide {

  0%,
  15%,
  85%,
  100% {
    transform: translateY(-100%);
  }

  35%,
  65% {
    transform: translateY(0);
  }
}

@keyframes preview-menu-items {

  0%,
  30%,
  80%,
  100% {
    opacity: 0;
    transform: translateY(5px);
  }

  40%,
  70% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hamburger Animation (Synced) */
.preview-n9 .hamburger span:nth-child(1) {
  animation: preview-hamburger-top 3s ease-in-out infinite;
}

.preview-n9 .hamburger span:nth-child(2) {
  animation: preview-hamburger-middle 3s ease-in-out infinite;
}

.preview-n9 .hamburger span:nth-child(3) {
  animation: preview-hamburger-bottom 3s ease-in-out infinite;
}

@keyframes preview-hamburger-top {

  0%,
  15%,
  85%,
  100% {
    transform: translateY(0) rotate(0);
  }

  35%,
  65% {
    transform: translateY(5px) rotate(45deg);
  }
}

@keyframes preview-hamburger-middle {

  0%,
  15%,
  85%,
  100% {
    opacity: 1;
    transform: translateX(0);
  }

  35%,
  65% {
    opacity: 0;
    transform: translateX(5px);
  }
}

@keyframes preview-hamburger-bottom {

  0%,
  15%,
  85%,
  100% {
    transform: translateY(0) rotate(0);
  }

  35%,
  65% {
    transform: translateY(-5px) rotate(-45deg);
  }
}

/* Note: Accessing children for complex hamburger animation via pure CSS keyframes on parent is tricky, 
   using rotation for simple feedback or we'd need named animations for each span */

/* --- S: State (Additions) --- */

/* S-9: Success Check (Existing) */
.preview-s9 {
  height: 100%;
  background: #f0fdf4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-s9 .check-circle {
  width: 48px;
  height: 48px;
  background: #22c55e;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* S-9: Success Checkmark */
.preview-s9 {
  height: 100%;
  background: #f0fdf4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-s9 .check-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  animation: popIn 3s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite;
}

.preview-s9 .check-circle::after {
  content: "✓";
}

@keyframes popIn {

  0%,
  20% {
    transform: scale(0);
    opacity: 0;
  }

  30%,
  80% {
    transform: scale(1);
    opacity: 1;
  }

  90%,
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

/* --- I: Interaction (Additions) --- */

/* I-7: Drag & Drop */
.preview-i7 {
  height: 100%;
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.preview-i7 .dnd-item {
  width: 140px;
  height: 32px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
}

.preview-i7 .dnd-item:first-child {
  animation: preview-dnd-swap-1 4s ease-in-out infinite;
}

.preview-i7 .dnd-item:last-child {
  animation: preview-dnd-swap-2 4s ease-in-out infinite;
}

.preview-i7 .dnd-item::before {
  content: "☰";
  color: #9ca3af;
  margin-right: 8px;
}

@keyframes preview-dnd-swap-1 {

  0%,
  20% {
    transform: translateY(0);
    z-index: 1;
  }

  40%,
  60% {
    transform: translateY(40px);
    z-index: 2;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  }

  80%,
  100% {
    transform: translateY(0);
    z-index: 1;
  }
}

@keyframes preview-dnd-swap-2 {

  0%,
  20% {
    transform: translateY(0);
  }

  40%,
  60% {
    transform: translateY(-40px);
  }

  80%,
  100% {
    transform: translateY(0);
  }
}

/* I-8: Image Carousel */
.preview-i8 {
  height: 100%;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-i8 .carousel-mock {
  width: 85%;
  height: 65%;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.preview-i8 .slides-track {
  display: flex;
  height: 100%;
  animation: preview-carousel-slide 6s ease-in-out infinite;
}

.preview-i8 .slide-panel {
  min-width: 100%;
  height: 100%;
}

.preview-i8 .carousel-arrows {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  pointer-events: none;
}

.preview-i8 .carousel-arrows span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
}

.preview-i8 .nav-dots {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
}

.preview-i8 .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.preview-i8 .dot:nth-child(1) {
  animation: i8-dot1 6s infinite;
}

.preview-i8 .dot:nth-child(2) {
  animation: i8-dot2 6s infinite;
}

.preview-i8 .dot:nth-child(3) {
  animation: i8-dot3 6s infinite;
}

@keyframes preview-carousel-slide {

  0%,
  28% {
    transform: translateX(0);
  }

  33%,
  61% {
    transform: translateX(-100%);
  }

  66%,
  94% {
    transform: translateX(-200%);
  }

  100% {
    transform: translateX(-200%);
  }
}

@keyframes i8-dot1 {

  0%,
  28% {
    background: #fff;
  }

  33%,
  100% {
    background: rgba(255, 255, 255, 0.3);
  }
}

@keyframes i8-dot2 {

  0%,
  28% {
    background: rgba(255, 255, 255, 0.3);
  }

  33%,
  61% {
    background: #fff;
  }

  66%,
  100% {
    background: rgba(255, 255, 255, 0.3);
  }
}

@keyframes i8-dot3 {

  0%,
  61% {
    background: rgba(255, 255, 255, 0.3);
  }

  66%,
  100% {
    background: #fff;
  }
}

/* I-9: Copy Button */
.preview-i9 {
  height: 100%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-i9 .cmd-mock {
  font-family: monospace;
  font-size: 10px;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px 0 0 4px;
  padding: 6px 10px;
  line-height: 1.2;
}

.preview-i9 .copy-btn-mock {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  border-left: none;
  border-radius: 0 4px 4px 0;
  padding: 6px 8px;
  line-height: 1.2;
  animation: preview-copy-click 3s infinite;
}

@keyframes preview-copy-click {

  0%,
  45% {
    background: #e5e7eb;
    color: #6b7280;
    transform: scale(1);
  }

  48% {
    transform: scale(0.95);
  }

  50%,
  85% {
    background: #dafbe1;
    color: #1a7f37;
    transform: scale(1);
  }

  90%,
  100% {
    background: #e5e7eb;
    color: #6b7280;
    transform: scale(1);
  }
}

/* I-10: Cookie Consent Banner */
.preview-i10 {
  height: 100%;
  background: #f3f4f6;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.preview-i10 .consent-bar-mock {
  width: 100%;
  background: #1d2242;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  animation: preview-consent-slide 4s ease-in-out infinite;
}

.preview-i10 .consent-text-mock {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.preview-i10 .consent-btns-mock {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.preview-i10 .consent-decline-mock {
  font-size: 7px;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  padding: 3px 6px;
  line-height: 1;
}

.preview-i10 .consent-accept-mock {
  font-size: 7px;
  color: #fff;
  background: #5c6ac4;
  border-radius: 3px;
  padding: 3px 6px;
  line-height: 1;
}

@keyframes preview-consent-slide {

  0%,
  15% {
    transform: translateY(100%);
  }

  25%,
  75% {
    transform: translateY(0);
  }

  85%,
  100% {
    transform: translateY(100%);
  }
}

/* --- I-011: Load More Button --- */
.preview-i11 {
  height: 100%;
  background: var(--panel-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 12px 14px;
  gap: 8px;
  overflow: hidden;
}

.preview-i11 .lm-rows {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
}

.preview-i11 .lm-row {
  height: 10px;
  background: var(--border);
  border-radius: 4px;
  width: 100%;
  animation: preview-lm-pulse 2.4s ease-in-out infinite;
}

.preview-i11 .lm-row:nth-child(2) {
  animation-delay: 0.15s;
  width: 85%;
}

.preview-i11 .lm-row:nth-child(3) {
  animation-delay: 0.3s;
  width: 92%;
}

.preview-i11 .lm-row:nth-child(4) {
  animation-delay: 0.45s;
  width: 78%;
}

.preview-i11 .lm-btn-mock {
  padding: 6px 16px;
  background: #111827;
  color: #fff;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  animation: preview-lm-btn 2.4s ease-in-out infinite;
}

@keyframes preview-lm-pulse {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

@keyframes preview-lm-btn {

  0%,
  40% {
    transform: scale(1);
    opacity: 1;
  }

  55% {
    transform: scale(0.97);
    opacity: 0.75;
  }

  70%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* --- V: Video (Additions) --- */

/* S-8: Empty State */
.preview-s8 {
  height: 100%;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #9ca3af;
}

.preview-s8 .empty-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 3s ease-in-out infinite;
}

.preview-s8 .empty-line {
  width: 80px;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
}

.preview-s8 .empty-btn {
  width: 60px;
  height: 20px;
  background: #5c6ac4;
  border-radius: 4px;
  margin-top: 4px;
}

/* V-5: Before/After (Existing) */
.preview-v5 {
  height: 100%;
  position: relative;
  background: #ddd;
  /* Placeholder for demo */
  background-size: cover;
  overflow: hidden;
}

.preview-v5::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: #999;
  /* Placeholder for demo */
  background-size: cover;
  border-right: 2px solid #fff;
  animation: slideCompare 3s ease-in-out infinite alternate;
}

@keyframes slideCompare {
  0% {
    width: 30%;
  }

  100% {
    width: 70%;
  }
}

.preview-v5 .before-after-preview {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-size: 24px;
  z-index: 2;
  mix-blend-mode: overlay;
}

/* V-6: Audio Player */
.preview-v6 {
  height: 100%;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
}

.preview-v6 .album-mock {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #FF9A9E, #FECFEF);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.preview-v6 .vis-bars {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 20px;
  padding-bottom: 4px;
}

.preview-v6 .bar {
  width: 3px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  height: 100%;
  animation: wave 1s infinite ease-in-out alternate;
}

.preview-v6 .bar:nth-child(1) {
  animation-delay: 0s;
  height: 50%;
}

.preview-v6 .bar:nth-child(2) {
  animation-delay: 0.15s;
  height: 100%;
}

.preview-v6 .bar:nth-child(3) {
  animation-delay: 0.3s;
  height: 40%;
}

.preview-v6 .bar:nth-child(4) {
  animation-delay: 0.45s;
  height: 80%;
}

.preview-v6 .bar:nth-child(5) {
  animation-delay: 0.6s;
  height: 60%;
}

.preview-v6 .progress-mock {
  width: 70px;
  height: 3px;
  background: #e0e4f0;
  border-radius: 2px;
  overflow: hidden;
}

.preview-v6 .progress-mock::after {
  content: '';
  display: block;
  width: 45%;
  height: 100%;
  background: #5c6ac4;
  border-radius: 2px;
}

.preview-v6 .play-btn-mock {
  width: 24px;
  height: 24px;
  background: #5c6ac4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
}

@keyframes wave {
  0% {
    height: 30%;
    opacity: 0.5;
  }

  100% {
    height: 100%;
    opacity: 1;
  }
}

/* ============================================
   Site Navigation (.site-nav)
   ============================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}

/* Offset body content for fixed nav height */
body {
  padding-top: 56px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-logo:hover {
  opacity: 0.85;
  transform: scale(1.02);
}

.nav-logo-img {
  height: 32px;
  width: auto;
}

.nav-search {
  flex: 1;
  max-width: 360px;
}

.nav-search input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
}

.nav-search input::placeholder {
  color: var(--muted);
}

.nav-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-link {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.nav-link:hover {
  border-color: var(--accent);
  background: var(--surface);
}

/* Hamburger button */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.nav-drawer {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel-bg);
}

.nav-drawer.open {
  display: flex;
}

.nav-drawer-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
}

.nav-drawer-link {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.nav-drawer-lang {
  padding-top: 4px;
}

@media (max-width: 768px) {

  .nav-search,
  .nav-actions {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }
}

/* ============================================
   Site Footer (.site-footer)
   ============================================ */
.site-footer {
  background: #020208;
  color: var(--muted);
  padding: 60px 24px 40px;
  margin-top: 80px;
  font-family: inherit;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  font-size: 13px;
  opacity: 0.6;
  margin: 8px 0;
}

.footer-operator {
  font-size: 12px;
  opacity: 0.4;
  display: block;
}

/* ============================================
   Subpage Layout (privacy, disclaimer, etc.)
   ============================================ */
body.subpage {
  background: var(--page-bg);
  color: var(--text);
}

body.subpage main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

body.subpage section {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 28px;
}

body.subpage h1 {
  font-size: 26px;
  margin: 0 0 20px;
}

body.subpage h2 {
  font-size: 18px;
  margin: 24px 0 8px;
}

body.subpage p,
body.subpage li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

body.subpage ul {
  padding-left: 20px;
  margin: 0 0 16px;
}

/* HubSpot form placeholder */
.hubspot-placeholder {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.request-form-wrapper {
  background: #ffffff;
  border-radius: 12px;
  padding: 32px;
  margin-top: 32px;
  color: #111827;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   AI Prompt Template (.ai-prompt-section)
   ============================================ */
.ai-prompt-section {
  position: relative;
}

.ai-prompt-section textarea {
  width: 100%;
  min-height: 140px;
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
}

.ai-prompt-copy {
  position: absolute;
  top: 52px;
  right: 32px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-bg);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}

.ai-prompt-copy:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.ai-prompt-copy.copied {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border-color: #4ade80;
}

/* ============================================
   Sticky Header Scroll Enhancement (L-005)
   ============================================ */

.site-nav.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(5, 5, 16, 0.92);
}

/* ============================================
   Breadcrumb Navigation (N-004)
   ============================================ */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--text);
}

.breadcrumb-separator {
  margin: 0 8px;
  opacity: 0.5;
}

.breadcrumb-current {
  font-weight: 600;
  color: var(--text);
}

/* ============================================
   Back to Top Button (N-006)
   ============================================ */

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease,
    background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--surface);
  border-color: var(--accent);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

@media (max-width: 640px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* ===== Load More Button ===== */
.load-more-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 32px 0 8px;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.load-more-btn:hover,
.load-more-btn:focus-visible {
  background: var(--surface);
  border-color: var(--muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.load-more-btn:active {
  transform: scale(0.97);
}

/* --- R-001: Remotion / Load More Demo Video Template --- */
.preview-r1 {
  height: 100%;
  background: #f0f2f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 10px 12px;
  gap: 8px;
  overflow: hidden;
}

.preview-r1 .r1-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: 100%;
  flex: 1;
  align-content: flex-end;
}

.preview-r1 .r1-card {
  height: 22px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 5px;
}

.preview-r1 .r1-card--new {
  background: #eff6ff;
  border-color: rgba(59, 130, 246, 0.5);
  animation: preview-r1-glow 2.8s ease-in-out infinite;
}

.preview-r1 .r1-btn-mock {
  padding: 5px 14px;
  background: #3b82f6;
  color: #fff;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  animation: preview-r1-btn 2.8s ease-in-out infinite;
}

@keyframes preview-r1-glow {
  0%, 30% { opacity: 0.3; transform: translateY(5px); }
  55%, 80% { opacity: 1; transform: translateY(0); box-shadow: 0 0 0 2px rgba(59,130,246,0.3); }
  100% { opacity: 1; box-shadow: none; }
}

@keyframes preview-r1-btn {
  0%, 40% { transform: scale(1); opacity: 1; }
  50%  { transform: scale(0.95); opacity: 0.8; }
  65%, 100% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   Card thumbnail — live iframe
   iframe is rendered at 300% then scaled to fill card-preview
   (.card-preview must be position: relative)
   ============================================================ */
.preview-r-live {
  position: absolute;
  top: 0;
  left: 0;
  width: 300%;
  height: 300%;
  transform: scale(0.3333);
  transform-origin: top left;
  pointer-events: none;
  border: none;
  display: block;
}

/* ============================================================
   iframe-embed — added by load-common.js when ?embed=thumb
   Hides nav/header/footer so only the demo section shows
   ============================================================ */
body.iframe-embed {
  padding-top: 0 !important;
}

body.iframe-embed #vibe-nav,
body.iframe-embed #vibe-header,
body.iframe-embed #vibe-footer,
body.iframe-embed .r-notice {
  display: none !important;
}

/* Inside embed: show only demo section, hide other sections */
body.iframe-embed main {
  padding: 0 !important;
  max-width: 100% !important;
}

body.iframe-embed .pattern-section:not(#demo_section) {
  display: none !important;
}

body.iframe-embed #demo_section {
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
}

body.iframe-embed #demo_section > h2,
body.iframe-embed #demo_section > p {
  display: none !important;
}