/* ===========================================================
   TradeNova — Variant Showcase
   Neutral dark "showroom" chrome so that both the light and the
   dark variant previews read cleanly inside their cards.
   =========================================================== */

:root {
  --bg:          #08090C;
  --bg-elev:     #101218;
  --bg-card:     #0D0F14;
  --border:      #1E2129;
  --border-soft: #171A21;
  --text:        #E8EAF0;
  --text-dim:    #9AA1B0;
  --text-faint:  #626A79;
  --gold:        #F0B429;
  --green:       #00C896;
  --radius:      14px;
  --font:        'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:        ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.wrap { width: min(1440px, 100% - 3rem); margin-inline: auto; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 9, 12, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 62px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mark-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--gold), var(--green));
}

.mark-sub {
  color: var(--text-faint);
  font-weight: 500;
}

.topbar-spacer { flex: 1; }

.count {
  font-size: 0.82rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- hero ---------- */

.hero {
  padding: 5rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -50% 20% auto -10%;
  height: 520px;
  background:
    radial-gradient(45% 60% at 20% 40%, rgba(240, 180, 41, 0.10), transparent 70%),
    radial-gradient(40% 55% at 70% 30%, rgba(0, 200, 150, 0.09), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.hero > * { position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
}

.eyebrow .pulse {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(0, 200, 150, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  70%  { box-shadow: 0 0 0 7px rgba(0, 200, 150, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 150, 0); }
}

.hero h1 {
  margin: 1.4rem 0 0;
  font-size: clamp(2.3rem, 5.5vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 800;
  max-width: 18ch;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--gold), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 1.2rem 0 0;
  max-width: 62ch;
  color: var(--text-dim);
  font-size: 1.05rem;
}

/* ---------- controls ---------- */

.controls {
  position: sticky;
  top: 62px;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  padding: 1.5rem 0 1.2rem;
  background: linear-gradient(var(--bg) 65%, transparent);
}

.filters { display: flex; gap: 0.4rem; }

.filters button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.filters button:hover { color: var(--text); border-color: #2C303A; }

.filters button[aria-pressed='true'] {
  color: #07080B;
  background: var(--text);
  border-color: var(--text);
  font-weight: 600;
}

.search {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}

.search input {
  width: 100%;
  font: inherit;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 2.4rem 0.45rem 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.search input::placeholder { color: var(--text-faint); }
.search input:focus { border-color: #333846; }

.search kbd {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font: 500 0.7rem/1 var(--mono);
  color: var(--text-faint);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.2rem 0.35rem;
  pointer-events: none;
}

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 1.6rem;
  padding-bottom: 5rem;
  list-style: none;
  margin: 0;
}

.card {
  position: relative;
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: #333846;
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}

.card[hidden] { display: none; }

/* stretch so every card's footer line sits on the same baseline in its row */
.card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  border-radius: var(--radius);
}

/* ---------- live preview ---------- */

.preview {
  position: relative;
  aspect-ratio: 1440 / 900;
  overflow: hidden;
  background: var(--preview-bg, var(--bg-elev));
  border-bottom: 1px solid var(--border);
}

/* The stage is a full 1440x900 viewport shrunk to the card's width by JS. */
.preview-stage {
  position: absolute;
  top: 0; left: 0;
  width: 1440px;
  height: 900px;
  transform-origin: 0 0;
}

.preview-frame {
  width: 1440px;
  height: 900px;
  border: 0;
  display: block;
  pointer-events: none;   /* the card handles the click, not the mini site */
}

.preview-skeleton {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--preview-bg, var(--bg-elev));
  transition: opacity 0.45s ease;
}

.preview.is-ready .preview-skeleton { opacity: 0; }

.spinner {
  width: 22px; height: 22px;
  border: 2px solid rgba(150, 150, 160, 0.25);
  border-top-color: rgba(150, 150, 160, 0.75);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.preview-veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(8, 9, 12, 0.35), rgba(8, 9, 12, 0.82));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover .preview-veil,
.card-link:focus-visible .preview-veil { opacity: 1; }

.veil-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: #07080B;
  background: var(--text);
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  transform: translateY(6px);
  transition: transform 0.2s ease;
}

.card:hover .veil-cta { transform: translateY(0); }

/* ---------- card body ---------- */

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.15rem 1.25rem 1.3rem;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.swatch {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.card-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.badge {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--text-faint);
}

.badge--light { color: #D8DCE4; border-color: #333846; }

.card-tagline {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--gold);
}

.card-desc {
  margin: 0.7rem 0 0;
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.95rem 0 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: 0.7rem;
  color: var(--text-faint);
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 0.18rem 0.45rem;
}

.card-foot {
  margin-top: auto;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border-soft);
}

.path {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* open-in-new-tab button, sits above the card link */
.newtab {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(8, 9, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
}

.card:hover .newtab,
.newtab:focus-visible { opacity: 1; }
.newtab:hover { background: rgba(8, 9, 12, 0.95); }

/* ---------- empty state ---------- */

.empty {
  padding: 4rem 0 6rem;
  text-align: center;
  color: var(--text-faint);
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--border-soft);
  padding: 2rem 0 3rem;
  font-size: 0.8rem;
  color: var(--text-faint);
}

.foot code { font-family: var(--mono); color: var(--text-dim); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .wrap { width: min(1440px, 100% - 2rem); }
  .hero { padding: 3.5rem 0 2rem; }
  .grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .newtab { opacity: 1; }
}

@media (max-width: 520px) {
  .controls { top: 62px; }
  .search { max-width: none; }
  .search kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
