:root {
  /* NextLevel brand */
  --nl-navy: #033362;
  --nl-deep-navy: #011528;
  --nl-navy-700: #034A8C;
  --nl-blue: #057EEF;
  --nl-blue-700: #0A52B8;
  --nl-blue-400: #4CA6FC;
  --nl-blue-100: #C3E1FE;
  --nl-burgundy: #7B102C;
  --nl-pale-blue: #EBF5FF;
  --nl-sky-100: #C8DCF5;
  --nl-gray-50: #F8FAFC;
  --nl-gray-100: #F1F5F9;
  --nl-gray-300: #CBD5E1;
  --nl-gray-500: #64748B;
  --nl-gray-700: #334155;
  --nl-gray-900: #0F172A;
  --nl-white: #FFFFFF;

  --shadow-card: 0 1px 2px rgba(3, 51, 98, .06), 0 8px 24px rgba(3, 51, 98, .07);
  --shadow-card-hover: 0 2px 4px rgba(3, 51, 98, .08), 0 16px 40px rgba(3, 51, 98, .14);
  --radius: 16px;
  --topbar-h: 55px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--nl-gray-700);
  background: var(--nl-gray-50);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: var(--nl-deep-navy);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-logo { height: 26px; width: auto; display: block; }

.brand-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, .22);
}

.brand-title {
  color: var(--nl-white);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 480px;
  justify-content: flex-end;
}

.repo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}

.repo-link:hover { border-color: var(--nl-blue); background: rgba(255, 255, 255, .12); }
.repo-link svg { width: 17px; height: 17px; }
.repo-link[hidden] { display: none; }

.search-wrap {
  position: relative;
  flex: 1 1 340px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--nl-blue-400);
  pointer-events: none;
}

#search {
  width: 100%;
  padding: 10px 14px 10px 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .07);
  color: var(--nl-white);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, background .15s;
}

#search::placeholder { color: rgba(255, 255, 255, .5); }

#search:focus {
  border-color: var(--nl-blue);
  background: rgba(255, 255, 255, .12);
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 15% -40%, rgba(5, 126, 239, .35), transparent 60%),
    linear-gradient(160deg, var(--nl-navy) 0%, var(--nl-deep-navy) 100%);
  color: var(--nl-white);
  padding: clamp(40px, 7vw, 72px) clamp(16px, 4vw, 40px) clamp(36px, 6vw, 56px);
}

.hero-inner { max-width: 1180px; margin: 0 auto; }

.hero h1 {
  margin: 0 0 12px;
  font-family: 'Anton', 'Inter', sans-serif;
  font-size: clamp(34px, 5.4vw, 52px);
  font-weight: 400;
  letter-spacing: .2px;
  line-height: 1.02;
}

.hero-sub {
  margin: 0 0 22px;
  font-size: clamp(15px, 2vw, 18px);
  color: var(--nl-blue-100);
  max-width: 620px;
}

.hero-meta { margin: 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.count-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: 13px;
  font-weight: 600;
  color: var(--nl-white);
}

.updated { font-size: 13px; color: rgba(255, 255, 255, .55); }

/* ---------- Filter bar ---------- */
.filterbar {
  position: sticky;
  top: var(--topbar-h);
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px clamp(16px, 4vw, 40px);
  max-width: 1260px;
  margin: 0 auto;
  background: var(--nl-gray-50);
}

.chip {
  appearance: none;
  border: 1px solid var(--nl-gray-300);
  background: var(--nl-white);
  color: var(--nl-gray-700);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .14s ease;
  white-space: nowrap;
}

.chip:hover { border-color: var(--nl-blue-400); color: var(--nl-navy); }

.chip[aria-pressed="true"] {
  background: var(--nl-navy);
  border-color: var(--nl-navy);
  color: var(--nl-white);
}

.chip .chip-count {
  margin-left: 7px;
  font-size: 11.5px;
  opacity: .65;
  font-weight: 500;
}

/* ---------- Featured / Quick Reference ---------- */
.featured {
  max-width: 1260px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 40px) 6px;
}

.featured-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--nl-gray-500);
}

.featured-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nl-blue);
  box-shadow: 0 0 0 3px rgba(5, 126, 239, .18);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.feature-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--nl-white);
  background:
    radial-gradient(420px 160px at 100% -40%, rgba(5, 126, 239, .35), transparent 70%),
    linear-gradient(135deg, var(--nl-navy) 0%, var(--nl-deep-navy) 100%);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: var(--shadow-card);
  transition: transform .16s ease, box-shadow .16s ease;
}

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

.feature-card .fc-main { min-width: 0; }

/* Stretched link — title link covers the whole command-center card. */
.fc-link { color: var(--nl-white); text-decoration: none; }
.fc-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.fc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.fc-repo {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .88);
  transition: background .15s;
}

.fc-repo:hover { background: rgba(255, 255, 255, .2); }
.fc-repo svg { width: 17px; height: 17px; }

.feature-card .fc-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--nl-blue-300);
  margin-bottom: 7px;
}

.feature-card h3 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--nl-white);
}

.feature-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--nl-blue-100);
}

.feature-card .fc-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--nl-blue);
  color: var(--nl-white);
  transition: transform .16s ease, background .16s ease;
}

.feature-card:hover .fc-launch {
  transform: translateX(3px);
  background: var(--nl-blue-400);
}

.feature-card .fc-launch svg { width: 20px; height: 20px; }

/* ---------- Collections (folders) ---------- */
.collections {
  max-width: 1260px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 40px) 6px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--nl-gray-500);
}

.section-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nl-navy-700);
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.folder-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--nl-gray-100);
  background: var(--nl-white);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  font-family: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.folder-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: var(--nl-blue-100); }
.folder-card:focus-visible { outline: 2px solid var(--nl-blue); outline-offset: 2px; }

.folder-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--nl-pale-blue);
  color: var(--nl-navy);
}

.folder-ic svg { width: 22px; height: 22px; }

.folder-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.folder-title { font-size: 16px; font-weight: 700; color: var(--nl-gray-900); letter-spacing: -.2px; }
.folder-desc { font-size: 13px; color: var(--nl-gray-500); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; }

.folder-count {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--nl-navy-700);
  background: var(--nl-pale-blue);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ---------- Back bar (folder drill-in) ---------- */
.backbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1260px;
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 40px) 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--nl-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
}

.back-btn:hover { color: var(--nl-blue-700); }
.back-btn:focus-visible { outline: 2px solid var(--nl-blue); outline-offset: 2px; border-radius: 4px; }
.back-btn svg { width: 16px; height: 16px; }

.crumb { font-size: 14px; font-weight: 700; color: var(--nl-gray-900); }
.crumb::before { content: "\203A"; color: var(--nl-gray-300); margin-right: 10px; font-weight: 400; }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  max-width: 1260px;
  margin: 4px auto 0;
  padding: 4px clamp(16px, 4vw, 40px) 64px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--nl-white);
  border: 1px solid var(--nl-gray-100);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  text-decoration: none;
  color: inherit;
  min-height: 168px;
}

.card.has-link { cursor: pointer; }

.card.has-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--nl-blue-100);
}

/* Stretched link — the title link covers the whole card so it stays clickable,
   while a nested repo link (higher z-index) remains independently clickable. */
.card-link { color: inherit; text-decoration: none; }
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  background: var(--nl-pale-blue);
  color: var(--nl-navy);
}

.badge[data-type="Ad Manager"]     { background: rgba(123, 16, 44, .1); color: var(--nl-burgundy); }
.badge[data-type="Video"]          { background: rgba(5, 126, 239, .12); color: var(--nl-blue-700); }
.badge[data-type="Blog"]           { background: rgba(10, 82, 184, .1); color: var(--nl-blue-700); }
.badge[data-type="Tool"]           { background: var(--nl-gray-100); color: var(--nl-gray-700); }
.badge[data-type="Guide"]          { background: rgba(76, 166, 252, .15); color: var(--nl-navy-700); }
.badge[data-type="Deck"]           { background: var(--nl-sky-100); color: var(--nl-navy); }
.badge[data-type="Site/Dashboard"] { background: rgba(1, 21, 40, .07); color: var(--nl-deep-navy); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--nl-gray-500);
  white-space: nowrap;
}

.status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nl-gray-300);
}

.status[data-status="live"]         { color: var(--nl-blue-700); }
.status[data-status="live"] .dot    { background: var(--nl-blue); box-shadow: 0 0 0 3px rgba(5,126,239,.18); }
.status[data-status="access"]       { color: var(--nl-navy-700); }
.status[data-status="access"] .dot  { background: var(--nl-navy-700); }
.status[data-status="needs-hosting"] .dot,
.status[data-status="needs-link"] .dot { background: var(--nl-burgundy); }
.status[data-status="needs-hosting"],
.status[data-status="needs-link"]   { color: var(--nl-burgundy); }
.status[data-status="internal"]       { color: var(--nl-gray-500); }
.status[data-status="internal"] .dot  { background: var(--nl-gray-500); }

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--nl-gray-900);
  letter-spacing: -.2px;
}

.card p.desc {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--nl-gray-500);
  flex: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--nl-gray-500);
  background: var(--nl-gray-50);
  border: 1px solid var(--nl-gray-100);
  padding: 3px 9px;
  border-radius: 999px;
}

.tag--meta {
  background: transparent;
  border: none;
  padding-left: 0;
  color: var(--nl-gray-500);
}

.open-cue {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--nl-blue);
  white-space: nowrap;
  transition: gap .16s ease;
}

.loading {
  padding: 48px 20px;
  text-align: center;
  color: var(--nl-gray-500);
  font-size: 14px;
}

.card.has-link:hover .open-cue { gap: 9px; }

.open-cue svg { width: 15px; height: 15px; transition: transform .16s ease; }

.card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.repo-chip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--nl-gray-500);
  transition: color .15s;
}

.repo-chip:hover { color: var(--nl-navy); }
.repo-chip svg { width: 15px; height: 15px; }

/* ---------- Present overlay ---------- */
.present-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: var(--nl-deep-navy);
}

.present-overlay[hidden] { display: none; }

.present-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 12px 18px;
  background: var(--nl-deep-navy);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.present-title {
  color: var(--nl-white);
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.present-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.present-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
  color: var(--nl-white);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.present-action:hover { background: rgba(255, 255, 255, .14); border-color: var(--nl-blue); }
.present-action:focus-visible { outline: 2px solid var(--nl-blue); outline-offset: 2px; }
.present-action[hidden] { display: none; } /* display:inline-flex above would otherwise defeat the hidden attribute */
.present-action svg { width: 15px; height: 15px; }

/* Close is visually de-emphasized (dimmer) and goes burgundy on hover so the destructive
   action reads differently from Download/Fullscreen. */
.present-close { border-color: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .7); }
.present-close:hover { background: rgba(123, 16, 44, .35); border-color: var(--nl-burgundy-light); color: var(--nl-white); }

.present-action kbd {
  font-family: inherit;
  font-size: 11px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 4px;
  padding: 1px 6px;
}

.present-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--nl-white);
}

/* ---------- Empty / footer ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--nl-gray-500);
}

.link-btn {
  background: none;
  border: none;
  color: var(--nl-blue);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 28px 20px 40px;
  font-size: 12.5px;
  color: var(--nl-gray-500);
  border-top: 1px solid var(--nl-gray-100);
}

.footer .dot { color: var(--nl-gray-300); }

@media (max-width: 560px) {
  .brand-title { display: none; }
  .brand-divider { display: none; }
  .topbar { gap: 12px; }
  .repo-link span { display: none; }
  .repo-link { padding: 9px 11px; }
  .present-bar { padding: 10px 12px; gap: 10px; }
  .present-controls { gap: 7px; }
  .present-action { padding: 8px 11px; }
  .present-action .pa-label, .present-action kbd { display: none; }
}
