/* ===============================================================
   PlugForge — Moodle Plugin Explorer
   Warm palette, DM Sans typography, geometric background pattern
   =============================================================== */

/* --- Reset & Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange-50:  #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-300: #fdba74;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-800: #9a3412;
  --orange-900: #7c2d12;

  --neutral-50:  #faf9f7;
  --neutral-100: #f0eeea;
  --neutral-200: #ddd9d1;
  --neutral-300: #c4beb2;
  --neutral-400: #a69e8f;
  --neutral-500: #8b8375;
  --neutral-600: #716a5e;
  --neutral-700: #5c564b;
  --neutral-800: #3d3932;
  --neutral-900: #1f1d1a;

  --blue-500:    #3b82f6;
  --green-500:   #22c55e;
  --red-500:     #ef4444;
  --amber-500:   #f59e0b;
  --purple-500:  #a855f7;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-card: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-elevated: 0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.05);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--neutral-800);
  background: var(--neutral-50);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* --- Geometric Background Pattern --- */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 50% at 0% 0%, rgba(251,146,60,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 100% 100%, rgba(251,146,60,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 50% 0%, rgba(249,115,22,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.bg-pattern::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(0,0,0,0.015) 40px, rgba(0,0,0,0.015) 41px),
    repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(0,0,0,0.015) 40px, rgba(0,0,0,0.015) 41px);
}

/* --- Container --- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px) saturate(1.8);
  border-bottom: 1px solid var(--neutral-200);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--neutral-900);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.logo-moodle {
  display: block;
  height: 28px;
  width: auto;
  max-width: 118px;
}

.logo-divider {
  width: 1px;
  height: 22px;
  background: var(--neutral-300);
  flex-shrink: 0;
}

.logo-text {
  line-height: 1;
}

.logo-icon { font-size: 1.5rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--neutral-600);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--orange-600);
  background: var(--orange-50);
}

.nav-sep { color: var(--neutral-300); font-size: 1.2rem; }
.nav-external { opacity: 0.8; }

.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--neutral-600);
  border-radius: 2px;
  transition: transform 0.3s;
}

/* --- Hero --- */
.hero {
  padding: 48px 0 32px;
  position: relative;
}

.hero-content { text-align: center; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  color: var(--neutral-900);
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-title .text-accent {
  color: var(--orange-500);
  font-style: italic;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--neutral-500);
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.45;
}

.search-form { max-width: 600px; margin: 0 auto; }

.search-bar {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  padding: 8px 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.search-bar:focus-within {
  border-color: var(--orange-400);
  box-shadow: 0 0 0 4px rgba(249,115,22,0.1);
}

.search-icon {
  flex-shrink: 0;
  color: var(--neutral-400);
  margin-right: 10px;
}

.search-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--neutral-800);
  outline: none;
  padding: 6px 0;
}

.search-input::placeholder { color: var(--neutral-400); }

.search-clear {
  text-decoration: none;
  color: var(--neutral-400);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 4px;
  transition: color 0.2s;
}

.search-clear:hover { color: var(--neutral-600); }

.ai-search-btn {
  flex-shrink: 0;
  margin-left: 8px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--neutral-900);
  color: white;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.ai-search-btn:hover { background: var(--orange-500); }
.ai-search-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.ai-search-btn.is-loading .ai-search-btn-label::after {
  content: "…";
}

.ai-search-hint {
  margin: 12px auto 0;
  max-width: 640px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--neutral-500);
}

.ai-search-hint strong {
  color: var(--neutral-700);
  font-weight: 600;
}

.ai-search-hint em {
  font-style: italic;
  color: var(--neutral-600);
}

.ai-banner {
  margin-bottom: 20px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  background: white;
  padding: 14px 16px;
}

.ai-banner.is-hidden { display: none; }

.ai-banner-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-banner-badge {
  flex-shrink: 0;
  background: var(--neutral-900);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 8px;
  border-radius: 6px;
}

.ai-banner-text { flex: 1; min-width: 200px; }

.ai-banner-interpretation {
  margin: 0;
  font-size: 0.95rem;
  color: var(--neutral-800);
  line-height: 1.45;
}

.ai-banner-query {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--neutral-500);
}

.ai-banner-keywords {
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-kw {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.ai-banner-clear {
  font-size: 0.8rem;
  color: var(--orange-600);
  text-decoration: none;
  white-space: nowrap;
}
.ai-banner-clear:hover { text-decoration: underline; }

.card-ai-reason {
  margin: 0 0 8px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--neutral-600);
  font-style: italic;
}

/* --- Filters --- */
.filters-section {
  padding: 8px 0 20px;
  position: sticky;
  top: 64px;
  z-index: 50;
  background: rgba(250,249,247,0.9);
  backdrop-filter: blur(8px);
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-500);
}

.filter-select {
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 8px 32px 8px 12px;
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: white 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='%238b8375' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  cursor: pointer;
  min-width: 140px;
  transition: border-color 0.2s;
}

.filter-select:focus {
  border-color: var(--orange-400);
  outline: none;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.08);
}

.filter-view-toggle {
  display: flex;
  gap: 4px;
  padding-top: 16px;
}

.filter-layout-toggle {
  margin-left: auto;
}

.filter-media-toggle {
  margin-left: 8px;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--neutral-500);
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn-text {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.view-btn:hover { border-color: var(--orange-300); color: var(--orange-500); }
.view-btn.active { border-color: var(--orange-400); color: var(--orange-600); background: var(--orange-50); }

/* --- Active filter chips --- */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 0;
}

.active-filters-label {
  font-size: 0.8rem;
  color: var(--neutral-500);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.8rem;
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  color: var(--neutral-700);
  text-decoration: none;
  transition: all 0.2s;
}

.chip:hover { border-color: var(--orange-300); }

.chip-remove {
  text-decoration: none;
  color: var(--neutral-400);
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s;
}

.chip-remove:hover { color: var(--red-500); }

.chip-clear {
  color: var(--orange-600);
  border-color: var(--orange-200);
  font-weight: 500;
}

.chip-clear:hover {
  background: var(--orange-50);
  border-color: var(--orange-400);
}

/* --- Results section --- */
.results-section {
  padding: 8px 0 48px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.results-count {
  font-size: 0.85rem;
  color: var(--neutral-500);
}

/* --- Grid View --- */
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* --- Plugin Card --- */
.plugin-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: cardIn 0.4s ease both;
  animation-delay: calc(var(--card-index, 0) * 30ms);
}

.plugin-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.plugin-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--neutral-100);
}

.card-thumb--shots {
  background:
    linear-gradient(145deg, #1c1917 0%, #292524 55%, #44403c 100%);
}

.card-thumb--logos {
  background: var(--neutral-100);
}

.card-img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Full screenshots: contain keeps them sharp (no soft upscale crop of tiny thumbs) */
.card-img--shot {
  object-fit: contain;
  object-position: center;
  image-rendering: -webkit-optimize-contrast;
}

/* Vector logos: fill the card edge-to-edge, stay crisp as SVG */
.card-img--logo {
  object-fit: cover;
  object-position: center;
}

.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-icon { font-size: 2.5rem; opacity: 0.5; }

.card-placeholder-mod .placeholder-icon { opacity: 0.6; }
.card-placeholder-block { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); }
.card-placeholder-theme { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.card-placeholder-local { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); }
.card-placeholder-auth { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); }
.card-placeholder-mod   { background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%); }
.card-placeholder-tool  { background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%); }
.card-placeholder-other { background: linear-gradient(135deg, #f0eeea 0%, #ddd9d1 100%); }

.card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.badge-stable { color: var(--green-500); }
.badge-beta   { color: var(--amber-500); }
.badge-alpha  { color: var(--red-500); }
.badge-rc     { color: var(--purple-500); }
.badge-github {
  color: #9a3412;
  background: #ffedd5 !important;
  border: 1px solid #fdba74;
}

/* Circular BETA / NO PROD seal (GitHub unofficial plugins) */
.beta-seal {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  filter: drop-shadow(0 2px 6px rgba(120, 53, 15, 0.45));
  pointer-events: none;
}
.beta-seal-svg {
  display: block;
  width: 56px;
  height: 56px;
}
.list-thumb .beta-seal-svg {
  width: 44px;
  height: 44px;
}

/* Diagonal ribbon on thumbnail — clearly non-official */
.github-ribbon {
  position: absolute;
  top: 14px;
  right: -34px;
  z-index: 3;
  width: 140px;
  padding: 5px 0;
  background: #b45309;
  color: #fffbeb;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(35deg);
  box-shadow: 0 2px 8px rgba(124, 45, 18, 0.35);
  pointer-events: none;
  overflow: hidden;
}
.github-ribbon-text {
  display: block;
  white-space: nowrap;
}
.list-thumb .github-ribbon {
  top: 10px;
  right: -40px;
  width: 120px;
  font-size: 0.55rem;
  padding: 3px 0;
}
.card-thumb,
.list-thumb {
  overflow: hidden;
  position: relative;
}
.card-source-tag {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: #9a3412;
  font-weight: 600;
  line-height: 1.3;
}

.plugin-card--github-beta {
  border: 1px solid #fdba74;
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.12);
}
.plugin-card--github-beta .card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.18) 0%, transparent 45%, rgba(124, 45, 18, 0.12) 100%);
  pointer-events: none;
}

/* Site-wide: PlugForge is independent / not Moodle official */
.site-beta-banner {
  position: relative;
  z-index: 20;
  background: linear-gradient(90deg, #7c2d12 0%, #b45309 50%, #9a3412 100%);
  color: #fffbeb;
  font-size: 0.8rem;
  line-height: 1.35;
}
.site-beta-banner-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.site-beta-pill {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fde68a;
  color: #7c2d12;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.site-beta-text {
  margin: 0;
  font-weight: 500;
}
.results-catalogue-total {
  color: var(--neutral-500);
  font-weight: 500;
}
.filter-select--source {
  border-color: #fdba74;
  background: #fffbeb;
  color: #9a3412;
  font-weight: 600;
}
.plugin-card--unmaintained,
.plugin-list-item--unmaintained {
  opacity: 0.88;
}
.plugin-list-item--github-beta {
  border-left: 3px solid #b45309;
}

.card-warning {
  margin: 0 0 6px;
  padding: 6px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
}
.card-unmaintained,
.card-stale {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-unmaintained {
  color: #7f1d1d;
  background: #fee2e2;
}
.card-stale {
  color: #92400e;
  background: #fef3c7;
}

.beta-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.beta-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.beta-toggle-ui {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #fdba74;
  background: #fffbeb;
  color: #9a3412;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.beta-toggle.is-on .beta-toggle-ui,
.beta-toggle input:checked + .beta-toggle-ui {
  background: #b45309;
  border-color: #9a3412;
  color: #fffbeb;
}
.beta-toggle-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: inset 0 0 0 2px #fff7ed;
  flex-shrink: 0;
}
.beta-toggle.is-on .beta-toggle-dot,
.beta-toggle input:checked + .beta-toggle-ui .beta-toggle-dot {
  background: #fde68a;
  box-shadow: inset 0 0 0 2px #7c2d12;
}
.beta-toggle-hint {
  margin: 4px 0 0;
  font-size: 0.7rem;
  color: var(--neutral-500);
  max-width: 220px;
  line-height: 1.3;
}
.filter-group--beta {
  min-width: 200px;
}
.chip-beta {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}
.hero-total-breakdown {
  display: block;
  margin-top: 8px;
  font-size: 0.95em;
  color: var(--neutral-600);
  line-height: 1.5;
}
.hero-total-sum {
  font-size: 1.15em;
  color: var(--neutral-900);
}
.hero-total-equation {
  display: inline-block;
  margin-left: 4px;
  color: var(--neutral-500);
}
.hero-total-equation strong {
  color: var(--neutral-800);
}
.results-beta-hint {
  color: #b45309;
  font-weight: 500;
}
.results-source-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e0f2fe;
  color: #075985;
  vertical-align: middle;
}
.results-source-badge--github {
  background: #ffedd5;
  color: #9a3412;
}
.source-github-live-count {
  color: #9a3412;
  font-weight: 700;
}

.github-beta-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
}
.github-beta-banner-seal {
  position: relative;
  flex-shrink: 0;
}
.github-beta-banner-seal .beta-seal {
  position: static;
  filter: none;
}
.github-beta-banner-body {
  font-size: 0.92rem;
  color: #7c2d12;
  line-height: 1.45;
}
.github-beta-banner-body strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
  color: #9a3412;
}
.github-beta-banner-body ul {
  margin: 8px 0 0;
  padding-left: 1.1rem;
}
.github-beta-banner-body li {
  margin: 2px 0;
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--neutral-900);
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-component {
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--neutral-400);
  margin-bottom: 10px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.card-type {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--neutral-100);
  border-radius: var(--radius-sm);
  color: var(--neutral-600);
}

.card-version {
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--neutral-500);
}

.card-date {
  font-size: 0.75rem;
  color: var(--neutral-400);
  margin-left: auto;
}

.card-cta {
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--orange-500);
  font-weight: 500;
}

/* --- List View --- */
.list-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plugin-list-item {
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  animation: cardIn 0.3s ease both;
  animation-delay: calc(var(--card-index, 0) * 15ms);
}

.plugin-list-item:hover {
  border-color: var(--orange-300);
  box-shadow: var(--shadow-card);
}

.list-item-link {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  padding: 12px 16px;
}

.list-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--neutral-100);
}

.list-thumb--shots {
  background: #1c1917;
}

.list-img {
  width: 100%;
  height: 100%;
  display: block;
}

.list-img--shot {
  object-fit: contain;
  object-position: center;
  image-rendering: -webkit-optimize-contrast;
}

.list-img--logo {
  object-fit: cover;
}

.list-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.list-placeholder .placeholder-icon { font-size: 1.2rem; }

.list-body { flex: 1; min-width: 0; }

.list-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--neutral-900);
}

.list-badge {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--neutral-100);
}

.list-component {
  font-size: 0.78rem;
  font-family: monospace;
  color: var(--neutral-400);
  margin-top: 1px;
}

.list-meta {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.list-type, .list-version, .list-date {
  font-size: 0.72rem;
  color: var(--neutral-500);
}

.list-arrow {
  font-size: 1.2rem;
  color: var(--neutral-300);
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
}

.plugin-list-item:hover .list-arrow {
  color: var(--orange-500);
  transform: translateX(3px);
}

/* --- Empty state --- */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
}

.empty-state-full { padding: 60px 20px; }

.empty-icon { font-size: 3rem; margin-bottom: 12px; }

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--neutral-700);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--neutral-500);
  margin-bottom: 20px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-xl);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--orange-500);
  color: white;
  box-shadow: 0 1px 3px rgba(249,115,22,0.3);
}

.btn-primary:hover {
  background: var(--orange-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249,115,22,0.35);
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0969da;
  color: white;
  box-shadow: 0 1px 3px rgba(9, 105, 218, 0.35);
}
.btn-github:hover {
  background: #0550ae;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9, 105, 218, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--neutral-700);
  border: 1.5px solid var(--neutral-200);
}

.btn-secondary:hover {
  border-color: var(--orange-400);
  color: var(--orange-600);
  background: var(--orange-50);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 0;
}

.pagination-full { grid-column: 1 / -1; }

.page-link {
  font-size: 0.9rem;
  color: var(--orange-600);
  text-decoration: none;
  padding: 8px 16px;
  border: 1.5px solid var(--orange-200);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.page-link:hover {
  background: var(--orange-50);
  border-color: var(--orange-400);
}

.page-info {
  font-size: 0.85rem;
  color: var(--neutral-500);
}

/* ====================================================================
   DETAIL PAGE
   ==================================================================== */

.detail-hero {
  padding: 24px 0 8px;
}

.breadcrumb {
  font-size: 0.82rem;
  color: var(--neutral-400);
}

.breadcrumb a {
  color: var(--neutral-500);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--orange-600); }

.breadcrumb-sep {
  margin: 0 6px;
  color: var(--neutral-300);
}

.detail-main { padding: 8px 0 40px; }

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
  align-items: start;
}

.detail-thumb-section {
  position: sticky;
  top: 144px;
}
.detail-thumb-section--github {
  position: sticky;
  overflow: hidden;
  border-radius: var(--radius-md);
}
.detail-thumb-section--github .beta-seal {
  top: 12px;
  left: 12px;
}
.detail-thumb-section--github .github-ribbon {
  top: 22px;
  right: -28px;
}

.detail-screenshot {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
  background: #1c1917;
  object-fit: contain;
  max-height: 480px;
  image-rendering: -webkit-optimize-contrast;
}

.detail-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--neutral-200);
}

.placeholder-icon-large { font-size: 4rem; opacity: 0.5; }
.placeholder-label {
  font-size: 0.85rem;
  color: var(--neutral-500);
  margin-top: 8px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  color: var(--neutral-900);
  line-height: 1.2;
  margin-bottom: 8px;
}

.detail-component {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-component code {
  font-size: 0.85rem;
  background: var(--neutral-100);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  color: var(--neutral-600);
}

.detail-type {
  font-size: 0.78rem;
  padding: 3px 10px;
  background: var(--orange-50);
  color: var(--orange-700);
  border-radius: var(--radius-sm);
}

.detail-description {
  font-size: 1rem;
  color: var(--neutral-600);
  line-height: 1.7;
  margin-bottom: 24px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-400);
}

.meta-value {
  font-size: 0.92rem;
  color: var(--neutral-800);
}

.maturity-alpha  { color: var(--red-500); }
.maturity-beta   { color: var(--amber-500); }
.maturity-rc     { color: var(--purple-500); }
.maturity-stable { color: var(--green-500); }

.detail-compatibility {
  margin-bottom: 24px;
}

.compatibility-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.compatibility-chip {
  padding: 4px 12px;
  font-size: 0.78rem;
  background: white;
  border: 1px solid var(--blue-500);
  color: var(--blue-500);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: all 0.2s;
}

.compatibility-chip:hover {
  background: rgba(59,130,246,0.08);
}

.detail-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--neutral-900);
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-400);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.detail-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--neutral-600);
  text-decoration: none;
  transition: color 0.2s;
}

.detail-link:hover { color: var(--orange-600); }

.link-icon { font-size: 1rem; }

/* --- Versions table --- */
.detail-versions {
  padding: 24px 0 48px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--neutral-900);
  margin-bottom: 16px;
}

.versions-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
}

.versions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.versions-table th {
  background: var(--neutral-100);
  color: var(--neutral-600);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-200);
}

.versions-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-100);
  color: var(--neutral-700);
}

.versions-table tr:last-child td { border-bottom: none; }
.versions-table tr:hover td { background: var(--neutral-50); }

.ver-version { font-family: monospace; font-weight: 600; color: var(--neutral-900); }
.ver-release { color: var(--neutral-600); }
.ver-date { color: var(--neutral-500); white-space: nowrap; }

.maturity-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.maturity-stable { background: rgba(34,197,94,0.1); color: var(--green-500); }
.maturity-beta   { background: rgba(245,158,11,0.1); color: var(--amber-500); }
.maturity-alpha  { background: rgba(239,68,68,0.1); color: var(--red-500); }
.maturity-rc     { background: rgba(168,85,247,0.1); color: var(--purple-500); }

.ver-moodle-chip {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  margin: 1px;
  background: rgba(59,130,246,0.06);
  color: var(--blue-500);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.ver-moodle-chip:hover { background: rgba(59,130,246,0.12); }
.ver-na { color: var(--neutral-300); }

.download-link {
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--neutral-400);
  transition: color 0.2s;
}

.download-link:hover { color: var(--orange-500); }

/* ====================================================================
   FEATURED PROJECTS — Adaptive Learn ecosystem
   ==================================================================== */

.featured-section {
  padding: 40px 0 8px;
}

.featured-header {
  text-align: center;
  margin-bottom: 24px;
}

.featured-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 400;
  color: var(--neutral-900);
  margin: 0 0 8px;
}

.featured-subtitle {
  margin: 0 auto;
  max-width: 540px;
  color: var(--neutral-500);
  font-size: 0.95rem;
  line-height: 1.45;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.featured-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 14px 0;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 168px;
  overflow: hidden;
}

.featured-item:hover {
  border-color: color-mix(in srgb, var(--feat-accent, var(--orange-500)) 45%, var(--neutral-200));
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(28, 25, 23, 0.06);
}

.featured-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--feat-accent, var(--orange-500));
}

.featured-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--neutral-100);
  flex-shrink: 0;
}

.featured-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.featured-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 0 16px 0 20px;
}

.featured-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--neutral-900);
  margin: 0;
  line-height: 1.2;
}

.featured-blurb {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--feat-accent, var(--orange-600));
}

.featured-desc {
  margin: 2px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--neutral-600);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-stack {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.72rem;
  color: var(--neutral-400);
  letter-spacing: 0.01em;
}

.featured-arrow {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.85rem;
  color: var(--neutral-400);
  transition: color 0.2s ease, transform 0.2s ease;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.featured-item:hover .featured-arrow {
  color: var(--feat-accent, var(--orange-600));
  transform: translate(2px, -2px);
}

@media (max-width: 1100px) {
  .featured-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .featured-item {
    min-height: 0;
  }
}

/* ====================================================================
   INSIGHTS — type treemap + Adaptive Learn ecosystem
   ==================================================================== */

.insights-section {
  padding: 48px 0 24px;
}

.insights-header {
  text-align: center;
  margin-bottom: 28px;
}

.insights-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 400;
  color: var(--neutral-900);
  margin: 0 0 8px;
}

.insights-subtitle {
  margin: 0 auto;
  max-width: 520px;
  color: var(--neutral-500);
  font-size: 0.95rem;
  line-height: 1.45;
}

/* Dynamic force graph — Adaptive Learn + all plugins */
.plugin-graph-panel {
  margin-bottom: 28px;
  padding: 18px 18px 14px;
  border-radius: 16px;
  border: 1px solid var(--neutral-200);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(234, 88, 12, 0.06), transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(13, 148, 136, 0.05), transparent 45%),
    #fff;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.04);
  text-align: left;
}
.plugin-graph-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 20px;
  margin-bottom: 12px;
}
.plugin-graph-title {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--neutral-900);
}
.plugin-graph-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--neutral-500);
  max-width: 42rem;
  line-height: 1.45;
}
.plugin-graph-status {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #9a3412;
}
.plugin-graph-canvas-wrap {
  position: relative;
  width: 100%;
  height: min(62vh, 560px);
  min-height: 380px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff7ed 0%, #fafaf9 55%, #f5f5f4 100%);
  border: 1px solid #e7e5e4;
  cursor: grab;
}
.plugin-graph-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.plugin-graph-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(28, 25, 23, 0.92);
  color: #fafaf9;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.plugin-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  font-size: 0.75rem;
  color: var(--neutral-600);
}
.plugin-graph-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}
.pg-dot--hub { width: 14px; height: 14px; background: #1c1917; }
.pg-dot--product { background: #ea580c; }
.pg-dot--type { background: #0d9488; }
.pg-dot--official { background: #2563eb; width: 7px; height: 7px; }
.pg-dot--github { background: #b45309; width: 7px; height: 7px; }

@media (max-width: 720px) {
  .plugin-graph-canvas-wrap {
    height: 420px;
    min-height: 320px;
  }
}

.insights-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.insight-card {
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.insight-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0 0 4px;
  color: var(--neutral-900);
}

.insight-card-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--neutral-500);
}

.insight-chart {
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fafaf9;
  border: 1px solid var(--neutral-100);
}

.insight-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.treemap-tile {
  cursor: pointer;
  transition: opacity 0.15s;
}
.treemap-tile:hover {
  opacity: 0.92;
  filter: brightness(1.05);
}

.eco-node { cursor: pointer; }
.eco-node:hover circle,
.eco-node:hover rect {
  filter: brightness(1.03);
}

.insight-legend,
.ecosystem-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.insight-legend a,
.ecosystem-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--neutral-700);
  font-size: 0.78rem;
}

.insight-legend a:hover,
.ecosystem-links a:hover {
  color: var(--orange-600);
}

.insight-legend strong {
  color: var(--neutral-500);
  font-weight: 600;
}

.legend-swatch,
.eco-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.eco-dot { border-radius: 50%; }

.eco-ext {
  color: var(--neutral-400);
  font-size: 0.7rem;
}

.visits-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.nav-adaptive {
  font-weight: 600;
  color: var(--orange-600);
}
.nav-adaptive:hover {
  color: var(--orange-500);
}

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

/* ====================================================================
   LIGHTBOX
   ==================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightboxIn 0.25s ease both;
}

.lightbox[hidden] {
  display: none;
}

@keyframes lightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 9, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lightbox-panel {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
  animation: lightboxZoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes lightboxZoomIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  object-fit: contain;
  display: block;
  background: #1c1917;
}

.lightbox-caption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  font-family: var(--font-display);
  text-align: center;
  max-width: 500px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -8px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s, transform 0.2s;
  z-index: 2;
}

.lightbox-close:hover {
  color: white;
  background: rgba(255,255,255,0.12);
  transform: rotate(90deg);
}

/* Lightbox trigger on cards — zoom cursor only for real screenshots */
.card-thumb--lightbox,
.list-thumb--lightbox {
  cursor: zoom-in;
}

.card-thumb--lightbox:active .card-img--shot,
.list-thumb--lightbox:active .list-img--shot {
  transform: scale(1.02);
  transition: transform 0.1s;
}

body.lightbox-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .lightbox-panel {
    max-width: 96vw;
    max-height: 90vh;
  }
  .lightbox-img {
    max-height: 70vh;
  }
  .lightbox-close {
    top: -36px;
    right: 0;
  }
}

/* ====================================================================
   SUBSCRIBE / REGISTRATION SECTION
   ==================================================================== */

.subscribe-section {
  padding: 48px 0 32px;
}

.subscribe-card {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid var(--orange-200);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.subscribe-content {
  flex: 1;
  min-width: 240px;
}

.subscribe-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--neutral-900);
  margin-bottom: 6px;
}

.subscribe-text {
  color: var(--neutral-600);
  font-size: 0.9rem;
  line-height: 1.5;
}

.subscribe-form {
  flex: 1;
  min-width: 280px;
}

.subscribe-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subscribe-input {
  flex: 1;
  min-width: 180px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  border: 1.5px solid var(--orange-200);
  border-radius: var(--radius-xl);
  background: white;
  color: var(--neutral-800);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.subscribe-input:focus {
  border-color: var(--orange-400);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.subscribe-input::placeholder { color: var(--neutral-400); }

.subscribe-name {
  min-width: 140px;
  flex: 0 1 auto;
}

.subscribe-btn {
  padding: 10px 24px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.subscribe-note {
  font-size: 0.75rem;
  color: var(--neutral-500);
  margin-top: 8px;
}

.subscribe-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: var(--radius-sm);
  color: #166534;
  font-size: 0.9rem;
}

.subscribe-success-icon {
  font-size: 1.3rem;
  font-weight: bold;
  color: #22c55e;
}

.subscribe-error {
  padding: 12px 20px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  color: #991b1b;
  font-size: 0.85rem;
}

/* --- Regístrate CTA badge in header --- */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(249,115,22,0.25);
}

.header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(249,115,22,0.35);
}

.header-cta-icon {
  font-size: 1rem;
}

/* --- Footer subscriber count --- */
.footer-subscribers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--neutral-400);
}

.footer-subscribers .sub-count {
  font-weight: 600;
  color: var(--orange-500);
}

/* --- Footer visit counter --- */
.footer-visit-counter {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.8rem;
}

.visits-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--neutral-400);
}

.visits-total {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--orange-500);
  line-height: 1;
}

.visits-unique {
  font-size: 0.75rem;
  color: var(--neutral-400);
  margin-left: 2px;
}

.footer-latest-visit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  margin-top: 4px;
  color: var(--neutral-500);
}

.latest-visit-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--neutral-400);
}

.latest-visit-flag {
  font-size: 1.2rem;
  line-height: 1;
}

.latest-visit-city {
  font-weight: 500;
  color: var(--neutral-700);
}

.latest-visit-country {
  color: var(--neutral-400);
  font-size: 0.78rem;
}

/* --- Confirm section --- */
.confirm-section {
  padding: 60px 0;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Footer --- */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--neutral-200);
  background: white;
}

.footer-inner {
  padding: 32px 24px;
  font-size: 0.8rem;
}

.footer-top-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.footer-brand-col {}

.footer-brand {
  color: var(--neutral-800);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  margin-bottom: 6px;
}

.footer-attribution {
  color: var(--neutral-400);
  font-size: 0.78rem;
  line-height: 1.5;
}

.footer-attribution a {
  color: var(--orange-500);
  text-decoration: none;
}

.footer-attribution a:hover { text-decoration: underline; }

.footer-stats-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: var(--neutral-500);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--orange-500); }

.link-sep {
  color: var(--neutral-300);
}

.footer-powered {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--neutral-200);
  text-align: center;
  font-size: 0.78rem;
  color: var(--neutral-400);
}

.footer-powered a {
  color: var(--orange-500);
  text-decoration: none;
}

.footer-powered a:hover { text-decoration: underline; }

.footer-trademark {
  margin: 10px auto 0;
  max-width: 720px;
  font-size: 0.68rem;
  line-height: 1.45;
  color: var(--neutral-400);
  text-align: center;
}

.footer-trademark a {
  color: var(--neutral-500);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ====================================================================
   RESPONSIVE
   ==================================================================== */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-elevated);
  }

  .nav-links.open { display: flex; }
  .nav-sep { display: none; }
  .mobile-nav-toggle { display: flex; }

  .logo-moodle {
    height: 22px;
    max-width: 92px;
  }
  .logo-text { font-size: 1.1rem; }

  .hero { padding: 32px 0 20px; }
  .hero-title { font-size: 1.8rem; }

  .filters-bar {
    flex-direction: column;
    gap: 8px;
  }

  .filter-select { width: 100%; }
  .filter-view-toggle { margin-left: 0; padding-top: 4px; }
  .view-btn-text { display: none; }

  .grid-view { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-body { padding: 12px; }
  .card-title { font-size: 0.9rem; }
  .card-meta { gap: 4px; }

  .detail-layout { grid-template-columns: 1fr; gap: 24px; }
  .detail-thumb-section { position: static; }
  .detail-meta-grid { grid-template-columns: 1fr 1fr; }
  .detail-stats { gap: 16px; }

  .footer-top-row { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .footer-stats-col { align-items: center; }
  .footer-links-col { align-items: center; }
  .footer-latest-visit { justify-content: center; }
  .footer-visit-counter { justify-content: center; }
  .insights-section { padding: 32px 0 16px; }
}

@media (max-width: 480px) {
  .grid-view { grid-template-columns: 1fr; }
  .detail-meta-grid { grid-template-columns: 1fr; }
}


/* Language pills */
.lang-pills {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.lang-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.lang-pill:hover {
  background: rgba(28, 25, 23, 0.06);
  transform: translateY(-1px);
}
.lang-pill.active {
  border-color: rgba(234, 88, 12, 0.45);
  background: rgba(234, 88, 12, 0.1);
}
.lang-more {
  position: relative;
}
.lang-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(28, 25, 23, 0.12);
  background: #fff;
  color: #57534e;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.lang-more-btn:hover {
  border-color: rgba(234, 88, 12, 0.4);
  color: #c2410c;
}
.lang-more-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 10rem;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid rgba(28, 25, 23, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(28, 25, 23, 0.12);
  z-index: 80;
}
.lang-more.open .lang-more-dropdown {
  display: block;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #1c1917;
  font-size: 0.875rem;
}
.lang-option:hover {
  background: rgba(28, 25, 23, 0.05);
}
.lang-option.active {
  background: rgba(234, 88, 12, 0.1);
  color: #c2410c;
}
.lang-native {
  white-space: nowrap;
}
@media (max-width: 900px) {
  .lang-pills {
    margin-left: 0;
    margin-right: 0.4rem;
    order: 2;
  }
  .header-cta {
    order: 3;
  }
}


/* --- AI examples marquee --- */
.search-form--ai { max-width: 720px; }

.examples-marquee {
  position: relative;
  margin-top: 1.25rem;
  padding: 0.35rem 0 0.15rem;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.examples-marquee .container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.marquee-track {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.marquee-track-inner {
  display: flex;
  gap: 0.6rem;
  width: max-content;
  animation: pf-marquee 42s linear infinite;
}

.examples-marquee.is-paused .marquee-track-inner {
  animation-play-state: paused;
}

@keyframes pf-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  max-width: 320px;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(28, 25, 23, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: #44403c;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
  text-align: left;
}

.marquee-chip:hover {
  border-color: rgba(234, 88, 12, 0.45);
  color: #c2410c;
  background: #fff7ed;
  transform: translateY(-1px);
}

.marquee-chip-arrow {
  color: #ea580c;
  font-weight: 700;
  flex-shrink: 0;
}

.marquee-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marquee-controls {
  flex-shrink: 0;
}

.marquee-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(28, 25, 23, 0.12);
  background: #fff;
  color: #57534e;
  cursor: pointer;
}

.marquee-btn:hover {
  border-color: rgba(234, 88, 12, 0.4);
  color: #c2410c;
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track-inner { animation: none; }
}
