/* ===========================================================================
   Elyndor /repo — Lab Styles (scoped to .lab-root)
   Vanilla CSS. No build step. CSP-safe (style-src 'self' 'unsafe-inline').

   Tokens are duplicated here intentionally so this page is self-contained —
   it does not depend on elyndor-tokens.css. Same values.
   =========================================================================== */

:root {
  --bg-0: #08080c;
  --bg-1: #0d0d10;
  --bg-2: #14141a;
  --bg-glass: rgba(13, 13, 16, 0.72);
  --bg-glass-strong: rgba(8, 8, 12, 0.86);

  --text-0: #fafaf8;
  --text-1: #e6e6e0;
  --text-2: #9a9a90;
  --text-3: #5e5e58;

  --border-glass:        rgba(255, 255, 255, 0.07);
  --border-glass-strong: rgba(255, 255, 255, 0.14);

  --teal:        #14b8a6;
  --teal-bright: #2dd4bf;
  --teal-glow:   rgba(20, 184, 166, 0.32);
  --teal-soft:   rgba(20, 184, 166, 0.12);
  --amber-accent:        #f5a524;     /* NEW badge ONLY */
  --amber-accent-glow:   rgba(245, 165, 36, 0.30);
  --green: #22c55e;                  /* FREE badge */
  --exp-dim: #71717a;                /* EXP badge */
  --red: #f43f5e;
  --gold: #e8b75a;

  --font-display: 'Playfair Display', 'SF Pro Display', Georgia, serif;
  --font-serif: 'Playfair Display', 'SF Pro Display', Georgia, serif;
  --font-body:    'Onest', -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                  'Inter', 'Segoe UI', 'Nunito', sans-serif;
  --font-mono:    'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', monospace;

  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 160ms;
  --t-base: 240ms;
  --t-slow: 400ms;

  --max: 1240px;
  --radius:     14px;
  --radius-sm:  8px;
  --radius-lg:  20px;
}

/* === Reset === */
.lab-root, .lab-root * { box-sizing: border-box; }
.lab-root {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-0);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.lab-root a { color: inherit; text-decoration: none; }
.lab-root img { display: block; max-width: 100%; }
.lab-root button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

/* ===========================================================================
   HERO  (~300px tall)
   =========================================================================== */
.lab-hero {
  position: relative;
  min-height: 300px;
  padding: 28px 32px 24px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 0%, rgba(20,184,166,0.10) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(20,184,166,0.06) 0%, transparent 60%),
    var(--bg-0);
  border-bottom: 1px solid var(--border-glass);
  overflow: hidden;
}
.lab-hero::after {
  /* Subtle grid texture */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: linear-gradient(180deg, black 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, black 0%, transparent 100%);
}
.lab-hero-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
}
.lab-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 15px;
  color: var(--amber-accent);
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(245, 165, 36, 0.30);
}
.lab-wordmark:hover { color: #fbcb6e; }
.lab-repo-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--teal-glow);
  border-radius: 999px;
  background: var(--teal-soft);
}

.lab-hero-center {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px 16px 16px;
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}
.lab-hero-title {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-0);
  margin: 0 0 10px;
}
.lab-hero-subtitle {
  font-size: 16px;
  color: var(--text-2);
  margin: 0;
  letter-spacing: 0.01em;
}

.lab-counter {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  letter-spacing: 0.04em;
  margin: 16px auto 0;
  padding-top: 16px;
  max-width: var(--max);
  width: 100%;
}
.lab-counter span { color: var(--text-1); }

/* ===========================================================================
   FILTER BAR (sticky)
   =========================================================================== */
.lab-filterbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.lab-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.lab-chip {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-glass-strong);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.lab-chip:hover {
  color: var(--text-0);
  border-color: var(--teal-glow);
  background: var(--teal-soft);
}
.lab-chip.active {
  background: var(--teal);
  color: #0a0a0a;
  border-color: var(--teal);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 4px 14px var(--teal-glow);
}
.lab-chip-count {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  opacity: 0.7;
}

/* ---- Search (header + mobile sheet) ---------------------------------- */
.lab-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 200px;
  max-width: 420px;
  position: relative;
  font-family: var(--font-mono);
  background: var(--bg-1);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  padding: 0 10px 0 12px;
  height: 36px;
  transition: border-color var(--t-fast) var(--ease-out),
              box-shadow   var(--t-fast) var(--ease-out),
              background   var(--t-fast) var(--ease-out);
}
.lab-search:hover { border-color: var(--teal-glow); }
.lab-search:focus-within {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.lab-search-icon {
  color: var(--text-3);
  flex: 0 0 auto;
  transition: color var(--t-fast) var(--ease-out);
}
.lab-search:focus-within .lab-search-icon { color: var(--teal); }
.lab-search-input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 0;
  height: 100%;
}
.lab-search-input::placeholder {
  color: var(--text-3);
  opacity: 1;
}
/* Hide the native search clear (Webkit shows one inside input[type=search]) */
.lab-search-input::-webkit-search-cancel-button,
.lab-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.lab-search-clear {
  flex: 0 0 auto;
  background: transparent;
  border: 0;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
}
.lab-search-clear:hover { color: var(--teal); background: var(--teal-soft); }
.lab-search-clear[hidden] { display: none; }

/* Hide mobile-sheet search by default; show only inside the sheet on mobile */
.lab-search-mobile { display: none; }

@media (max-width: 600px) {
  /* On mobile the chips become a sheet, so move the search there too */
  .lab-search:not(.lab-search-mobile) { display: none; }
  .lab-search-mobile {
    display: flex;
    flex: 1 1 100%;
    max-width: none;
    margin-bottom: 8px;
  }
}

.lab-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lab-sort label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lab-sort-select {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-1);
  color: var(--text-1);
  border: 1px solid var(--border-glass-strong);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease-out);
}
.lab-sort-select:hover,
.lab-sort-select:focus {
  border-color: var(--teal);
  outline: none;
}

.lab-filter-toggle {
  display: none;        /* shown on mobile only */
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-glass-strong);
  background: var(--bg-1);
  color: var(--text-1);
}

/* ===========================================================================
   GRID
   =========================================================================== */
.lab-grid-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px;
}
.lab-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .lab-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .lab-grid { grid-template-columns: 1fr; }
  .lab-hero { padding: 20px 16px 16px; min-height: 260px; }
  .lab-hero-title { font-size: 32px; }
  .lab-hero-subtitle { font-size: 14px; }
  .lab-filterbar { padding: 12px 16px; }
  .lab-grid-wrap { padding: 20px 16px; }
  .lab-chip-row-desktop { display: none; }
  .lab-filter-toggle { display: inline-flex; }
}

/* ===========================================================================
   CARD
   =========================================================================== */
.lab-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}
.lab-card::after {
  /* gradient sweep on hover */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg,
    transparent 0%,
    transparent 40%,
    rgba(20, 184, 166, 0.18) 50%,
    transparent 60%,
    transparent 100%);
  transform: translateX(-100%);
  transition: transform 1.2s var(--ease-out);
  opacity: 0;
}
.lab-card:hover {
  border-color: var(--teal);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45), 0 0 0 1px var(--teal-glow);
  transform: translateY(-2px);
}
.lab-card:hover::after {
  opacity: 1;
  transform: translateX(100%);
}
.lab-card:hover .lab-card-thumb img,
.lab-card:hover .lab-card-thumb .lab-card-thumb-svg {
  opacity: 0.85;
}

.lab-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-2);
  overflow: hidden;
  border-bottom: 1px solid var(--border-glass);
}
.lab-card-thumb img,
.lab-card-thumb .lab-card-thumb-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--t-base) var(--ease-out);
}

.lab-card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.lab-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1;
}
.lab-badge-new {
  background: var(--amber-accent);
  color: #1a1a1a;
  box-shadow: 0 2px 8px var(--amber-accent-glow);
}
.lab-badge-new.pulse {
  animation: labBadgePulse 1.8s ease-in-out infinite;
}
@keyframes labBadgePulse {
  0%, 100% { box-shadow: 0 2px 8px var(--amber-accent-glow); }
  50%      { box-shadow: 0 2px 8px var(--amber-accent-glow), 0 0 0 6px rgba(245,165,36,0.18); }
}
.lab-badge-free {
  background: var(--green);
  color: #0a1f12;
}
.lab-badge-exp {
  background: rgba(113,113,122,0.85);
  color: #fafafa;
  border: 1px solid rgba(255,255,255,0.10);
}

.lab-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

html {
  background-color: #1f1f23;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.02) 0px,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 4px
    ),
    radial-gradient(
      ellipse at center,
      rgba(50, 50, 55, 0.5) 0%,
      rgba(20, 20, 25, 0) 70%
    );
  min-height: 100%;
}

.lab-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-0); /* default cream — overridden for skill packs below */
  letter-spacing: -0.01em;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Skill packs: orange title (Hermes theme) */
.lab-card--hermes .lab-card-title {
  color: #f5a524;
}
.lab-card-desc {
  font-size: 14px;
  color: var(--text-2);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.lab-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}
.lab-card-price { color: var(--text-0); font-weight: 600; }
.lab-card-price.free { color: var(--green); }

.lab-buy-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: 1px solid var(--teal);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-bright) 100%);
  color: #0a0a0a;
  box-shadow: 0 4px 14px var(--teal-glow), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: all var(--t-fast) var(--ease-out);
  cursor: pointer;
}
.lab-buy-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--teal-glow), inset 0 1px 0 rgba(255,255,255,0.30);
}
.lab-buy-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px var(--teal-glow), inset 0 1px 0 rgba(255,255,255,0.20);
}
.lab-buy-btn.is-free {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
  box-shadow: 0 4px 14px rgba(34,197,94,0.18), inset 0 1px 0 rgba(255,255,255,0.10);
}
.lab-buy-btn.is-free:hover {
  background: rgba(34,197,94,0.10);
  filter: none;
}

/* ===========================================================================
   MODAL
   =========================================================================== */
.lab-modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 24px;
  animation: labFade 0.18s var(--ease-out);
}
.lab-modal-root.open { display: flex; }
@keyframes labFade { from { opacity: 0; } to { opacity: 1; } }

.lab-modal {
  position: relative;
  width: 720px;
  max-width: 100%;
  max-height: 80vh;
  background: var(--bg-1);
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.65), 0 0 0 1px rgba(255,255,255,0.04);
  overflow-y: auto;
  animation: labSlide 0.22s var(--ease-out);
}
@keyframes labSlide {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.lab-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border-glass-strong);
  color: var(--text-1);
  font-size: 18px;
  line-height: 1;
  z-index: 4;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast) var(--ease-out);
}
.lab-modal-close:hover {
  background: var(--bg-glass-strong);
  color: var(--text-0);
  border-color: var(--teal-glow);
}

.lab-modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, var(--bg-1) 70%, rgba(13,13,16,0.85) 100%);
  padding: 32px 32px 18px;
  border-bottom: 1px solid var(--border-glass);
}
.lab-modal-title {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 60px 12px 0;
  color: var(--text-0);
  padding-right: 60px;
}
.lab-modal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.lab-modal-meta-left {
  display: flex;
  gap: 14px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.lab-modal-price {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-0);
}
.lab-modal-price.free { color: var(--green); }

.lab-modal-buy-sticky {
  position: sticky;
  top: 12px;
  z-index: 5;
}

.lab-modal-body {
  padding: 0;
}
.lab-modal-body h3 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 24px 0 10px;
}
.lab-modal-body h3:first-child { margin-top: 0; }
.lab-modal-body p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-1);
  margin: 0 0 12px;
}
.lab-modal-body ul {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.65;
}
.lab-modal-body ul li { margin-bottom: 4px; }
.lab-modal-body code,
.lab-modal-body pre {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-0);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text-1);
}
.lab-modal-body pre {
  padding: 14px;
  overflow-x: auto;
  line-height: 1.5;
  margin: 8px 0 16px;
}
.lab-modal-body pre code { background: none; border: none; padding: 0; }

.lab-modal-author-note {
  font-style: italic;
  color: var(--text-2);
  border-left: 2px solid var(--teal);
  padding: 6px 14px;
  margin: 16px 0;
  background: var(--teal-soft);
  border-radius: 0 6px 6px 0;
  font-size: 14px;
}

.lab-modal-preview {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  background: var(--bg-0);
  padding: 14px;
  margin-top: 8px;
}
.lab-modal-preview img {
  width: 100%;
  border-radius: 4px;
}
.lab-modal-preview a {
  color: var(--teal);
  border-bottom: 1px solid var(--teal-glow);
}
.lab-modal-preview a:hover { color: var(--teal-bright); border-color: var(--teal); }

.lab-modal-related {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.lab-related-card {
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.lab-related-card:hover {
  border-color: var(--teal-glow);
  background: var(--bg-glass-strong);
}
.lab-related-card .lab-related-thumb {
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--bg-0);
}
.lab-related-card .lab-related-thumb img,
.lab-related-card .lab-related-thumb svg {
  width: 100%; height: 100%; object-fit: cover;
}
.lab-related-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-0);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lab-related-card .lab-related-price {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}

/* Empty / error states */
.lab-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 20px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 14px;
}
.lab-empty-clear {
  display: inline-block;
  margin-left: 6px;
  background: transparent;
  border: 1px solid var(--teal-glow);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.lab-empty-clear:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
}

/* Mobile filter sheet */
.lab-filter-sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.6);
  padding: 0;
}
.lab-filter-sheet.open { display: flex; }
.lab-filter-sheet-inner {
  width: 100%;
  background: var(--bg-1);
  border-top: 1px solid var(--border-glass-strong);
  border-radius: 16px 16px 0 0;
  padding: 16px 16px 24px;
  max-height: 70vh;
  overflow-y: auto;
  animation: labSlideUp 0.22s var(--ease-out);
}
@keyframes labSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.lab-filter-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.lab-filter-sheet-header h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  margin: 0;
  color: var(--text-1);
  letter-spacing: 0.04em;
}
.lab-filter-sheet-close {
  font-size: 22px;
  color: var(--text-2);
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
}
.lab-filter-sheet .lab-chips {
  flex-direction: column;
  gap: 6px;
}
.lab-filter-sheet .lab-chip {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
}

/* ===========================================================================
   MOBILE MODAL — full-screen
   =========================================================================== */
@media (max-width: 600px) {
  .lab-modal-root { padding: 0; }
  .lab-modal {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
  .lab-modal-header { padding: 24px 18px 16px; }
  .lab-modal-title { font-size: 22px; padding-right: 50px; margin-right: 50px; }
  .lab-modal-body { padding: 0; }
  .lab-modal-related { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .lab-root *, .lab-root *::before, .lab-root *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* TK-063: hero count-up */
.lab-hero-shipped-line {
  color: var(--text-0);
  font-size: 18px;
  letter-spacing: 0;
}
/* Bump specificity to override .lab-counter span { color: var(--text-1) } */
.lab-counter .lab-hero-shipped {
  color: var(--gold);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: inherit;
  display: inline-block;
}
.lab-counter-caption {
  margin-top: 5px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* TK-063: new-this-week strip */
.lab-newstrip {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 32px 0;
}
.lab-newstrip-row {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-1);
  border: 1px solid var(--border-glass);
}
.lab-newstrip-row > .lab-card { flex: 1 1 0; }
.lab-strip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.lab-strip-header h2 {
  margin: 0;
  color: var(--text-0);
  font-family: var(--font-mono);
  font-size: 16px;
}
@media (max-width: 899px) {
  .lab-newstrip-row { flex-direction: column; }
}
@media (max-width: 600px) {
  .lab-newstrip { padding: 20px 16px 0; }
}

/* TK-063: recently-viewed strip */
.lab-recent {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px 40px;
}
.lab-recent-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.lab-mini-card {
  flex: 0 0 200px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-1);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
}
.lab-mini-card:hover { border-color: var(--teal); }
.lab-mini-thumb { aspect-ratio: 16 / 9; overflow: hidden; }
.lab-mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lab-mini-body { padding: 0; }
.lab-mini-body h3 {
  margin: 0 0 8px;
  color: var(--text-0);
  font-size: 13px;
  line-height: 1.3;
}
.lab-recent-clear {
  color: var(--teal);
  border: 1px solid var(--border-glass);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
}
@media (max-width: 600px) {
  .lab-recent { padding: 0 16px 28px; }
}
@media (max-width: 319px) {
  .lab-recent { display: none; }
}

/* === HERO IMAGE (Repo) === */
.lab-hero-image {
  display: block;
  width: min(720px, 90%);
  height: auto;
  margin: 0 auto 20px;
  user-select: none;
  -webkit-user-drag: none;
}

}

/* === MATRIX RAIN EFFECT (Rebuild 2026-07-14) === */
/* Every leaf text node inside .matrix-rain must contain exactly "Elyndor" */
.matrix-rain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  font-family: var(--font-mono, monospace);
  /* Travel distance is hero height (300px) + tallest column (~168px) = ~468px */
  /* But we use transform: translate3d with a fixed Y distance that covers the hero */
}

.matrix-stream {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #00ff41;
  white-space: nowrap;
  opacity: var(--mr-o, 0.8);
  filter: blur(var(--mr-blur, 0px));
  transform: translate3d(var(--mr-x, 0px), 0, 0) scale(var(--mr-sc, 1));
  animation: matrix-rain-fall var(--mr-d, 14s) linear infinite;
  animation-delay: var(--mr-del, 0s);
  will-change: transform, opacity;
}

.matrix-stream > span {
  display: block;
  padding: 0 2px;
  color: #00ff41;
  text-shadow: 0 0 4px rgba(0, 255, 65, 0.7);
}

@keyframes matrix-rain-fall {
  0% {
    transform: translate3d(var(--mr-x, 0px), 0, 0) scale(var(--mr-sc, 1));
    opacity: 0;
  }
  10% { opacity: var(--mr-o, 0.8); }
  90% { opacity: var(--mr-o, 0.8); }
  100% {
    transform: translate3d(var(--mr-x, 0px), 500px, 0) scale(var(--mr-sc, 1));
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .matrix-stream { animation: none; opacity: 0; }
}
/* Per-column variation */
.matrix-stream:nth-child(1)  { left:32.0px; animation-duration:8.7s; animation-delay:-1.3s; --mr-o:0.53; --mr-blur:0.4px; --mr-sc:0.89; }
.matrix-stream:nth-child(2)  { left:96.0px; animation-duration:9.4s; animation-delay:-2.6s; --mr-o:0.66; --mr-blur:0.7px; --mr-sc:0.94; }
.matrix-stream:nth-child(3)  { left:160.0px; animation-duration:10.1s; animation-delay:-3.9s; --mr-o:0.79; --mr-blur:1.1px; --mr-sc:0.98; }
.matrix-stream:nth-child(4)  { left:224.0px; animation-duration:10.8s; animation-delay:-5.2s; --mr-o:0.92; --mr-blur:1.5px; --mr-sc:1.02; }
.matrix-stream:nth-child(5)  { left:288.0px; animation-duration:11.5s; animation-delay:-6.5s; --mr-o:0.45; --mr-blur:1.9px; --mr-sc:1.06; }
.matrix-stream:nth-child(6)  { left:352.0px; animation-duration:12.2s; animation-delay:-7.8s; --mr-o:0.58; --mr-blur:0.2px; --mr-sc:1.11; }
.matrix-stream:nth-child(7)  { left:416.0px; animation-duration:12.9s; animation-delay:-1.1s; --mr-o:0.71; --mr-blur:0.6px; --mr-sc:0.85; }
.matrix-stream:nth-child(8)  { left:480.0px; animation-duration:13.6s; animation-delay:-2.4s; --mr-o:0.84; --mr-blur:1.0px; --mr-sc:0.89; }
.matrix-stream:nth-child(9)  { left:544.0px; animation-duration:14.3s; animation-delay:-3.7s; --mr-o:0.97; --mr-blur:1.3px; --mr-sc:0.94; }
.matrix-stream:nth-child(10)  { left:608.0px; animation-duration:15.0s; animation-delay:-5.0s; --mr-o:0.5; --mr-blur:1.7px; --mr-sc:0.98; }
.matrix-stream:nth-child(11)  { left:672.0px; animation-duration:15.7s; animation-delay:-6.3s; --mr-o:0.63; --mr-blur:0.1px; --mr-sc:1.02; }
.matrix-stream:nth-child(12)  { left:736.0px; animation-duration:16.4s; animation-delay:-7.6s; --mr-o:0.76; --mr-blur:0.4px; --mr-sc:1.07; }
.matrix-stream:nth-child(13)  { left:800.0px; animation-duration:17.1s; animation-delay:-0.9s; --mr-o:0.89; --mr-blur:0.8px; --mr-sc:1.11; }
.matrix-stream:nth-child(14)  { left:864.0px; animation-duration:17.8s; animation-delay:-2.2s; --mr-o:0.42; --mr-blur:1.2px; --mr-sc:0.85; }
.matrix-stream:nth-child(15)  { left:928.0px; animation-duration:8.5s; animation-delay:-3.5s; --mr-o:0.55; --mr-blur:1.5px; --mr-sc:0.89; }
.matrix-stream:nth-child(16)  { left:992.0px; animation-duration:9.2s; animation-delay:-4.8s; --mr-o:0.68; --mr-blur:1.9px; --mr-sc:0.94; }
.matrix-stream:nth-child(17)  { left:1056.0px; animation-duration:9.9s; animation-delay:-6.1s; --mr-o:0.81; --mr-blur:0.3px; --mr-sc:0.98; }
.matrix-stream:nth-child(18)  { left:1120.0px; animation-duration:10.6s; animation-delay:-7.4s; --mr-o:0.94; --mr-blur:0.7px; --mr-sc:1.02; }
.matrix-stream:nth-child(19)  { left:1184.0px; animation-duration:11.3s; animation-delay:-0.7s; --mr-o:0.47; --mr-blur:1.0px; --mr-sc:1.07; }
.matrix-stream:nth-child(20)  { left:1248.0px; animation-duration:12.0s; animation-delay:-2.0s; --mr-o:0.6; --mr-blur:1.4px; --mr-sc:1.11; }

}

/* === TK-HERMES-ORANGE: skill pack cards (lr-037 → lr-040) get Hermes orange accent === */
.lab-card--hermes {
  border-top: 1px solid rgba(251, 146, 60, 0.35) !important;
  box-shadow:
    0 0 0 1px rgba(251, 146, 60, 0.20) inset,
    0 8px 24px rgba(251, 146, 60, 0.10) !important;
}
.lab-card--hermes .lab-card-thumb {
  background:
    linear-gradient(135deg, rgba(251, 146, 60, 0.18), rgba(245, 158, 11, 0.08)) !important;
  border-bottom: 1px solid rgba(251, 146, 60, 0.30) !important;
}
.lab-card--hermes .lab-card-title {
  background: linear-gradient(135deg, #fb923c, #fbbf24) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
.lab-card--hermes .lab-card-price {
  color: #fb923c !important;
}
.lab-card--hermes .lab-card-badges .lab-badge.hermes-pill,
.lab-card--hermes .lab-badge.helix,
.lab-card--hermes .lab-badge.hermes {
  background: linear-gradient(135deg, #fb923c, #f59e0b) !important;
  color: #1a1208 !important;
  border-color: rgba(251, 146, 60, 0.50) !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
}
.lab-card--hermes:hover {
  border-top-color: rgba(251, 146, 60, 0.65) !important;
  box-shadow:
    0 0 0 1px rgba(251, 146, 60, 0.35) inset,
    0 12px 28px rgba(251, 146, 60, 0.18) !important;
  transform: translateY(-2px) !important;
}
.lab-card--hermes .lab-card-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(251, 146, 60, 0.30) 0%, transparent 50%);
  pointer-events: none;
}
/* Make sure mobile gets the orange too - inherited from base, just re-confirm */
@media (max-width: 768px) {
  .lab-card--hermes {
    border-top-color: rgba(251, 146, 60, 0.45) !important;
  }
  .lab-card--hermes .lab-card-thumb {
    background:
      linear-gradient(135deg, rgba(251, 146, 60, 0.22), rgba(245, 158, 11, 0.10)) !important;
  }
}

/* === TK-FUNNEL-UPSELL: appears inside modal after meta for free items === */
.lab-modal-upsell-wrap {
  margin: 20px 0 0;
  padding: 0;
}
.lab-modal-upsell {
  position: relative;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.10), rgba(245, 165, 36, 0.06));
  border: 1px solid rgba(20, 184, 166, 0.35);
  border-radius: 12px;
  overflow: hidden;
}
.lab-modal-upsell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 0% 0%, rgba(20, 184, 166, 0.20) 0%, transparent 60%);
  pointer-events: none;
}
.lab-modal-upsell-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.20em;
  color: #14b8a6;
  margin-bottom: 6px;
}
.lab-modal-upsell-title {
  font-size: 18px;
  font-weight: 700;
  color: #fafafa;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.lab-modal-upsell-reason {
  font-size: 13px;
  line-height: 1.5;
  color: #b9b0a4;
  margin-bottom: 14px;
}
.lab-modal-upsell-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 184, 166, 0.20);
}
.lab-modal-upsell-price {
  font-size: 20px;
  font-weight: 800;
  color: #fafafa;
  letter-spacing: -0.02em;
}
.lab-modal-upsell-btn {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  border: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}
.lab-modal-upsell-btn:hover {
  filter: brightness(1.10);
  transform: translateY(-1px);
}
