:root {
  /* Hint to the browser/OS that this page is dark-themed (improves native form controls). */
  color-scheme: dark;

  --bg: #020617;
  --bg-elevated: rgba(9, 13, 34, 0.96);
  --accent: #3b82f6;
  --accent-strong: #60a5fa;
  --text-main: #f5f5f5;
  --text-muted: #9ca3af;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.65);
  --shadow-subtle: 0 10px 25px rgba(0, 0, 0, 0.45);
  --transition-med: 0.22s ease-out;
}

* { box-sizing: border-box; }
html { min-height: 100%; }

/* Dark-native inputs/selects (especially dropdown option menus on Windows). */
input.control,
select.control {
  color-scheme: dark;
}

/* Browser support varies, but this fixes the common "white dropdown" issue. */
select.control option,
select.control optgroup {
  background: var(--bg);
  color: var(--text-main);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);

  background-color: var(--bg);
  background-image: url("../data/nb-bg-main.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;

  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 12px;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -15%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 22% 30%, rgba(56, 189, 248, 0.35), transparent 58%),
    radial-gradient(circle at 78% 80%, rgba(59, 130, 246, 0.22), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.4;
  filter: blur(16px);
  transform-origin: center;
  animation: nbNebulaDrift 40s ease-in-out infinite alternate;
}

@keyframes nbNebulaDrift {
  0% { transform: translate3d(-40px, -20px, 0) scale(1); opacity: 0.35; }
  50% { transform: translate3d(10px, 10px, 0) scale(1.04); opacity: 0.5; }
  100% { transform: translate3d(40px, -30px, 0) scale(1.02); opacity: 0.38; }
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

.page {
  width: 100%;
  max-width: 1220px;
  position: relative;
  z-index: 1;
}

.page-inner {
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.top {
  padding: 18px 18px 0;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.brand-mark img { width: 46px; height: 46px; object-fit: contain; }

.brand-text h1 { margin: 2px 0 2px; font-size: 20px; letter-spacing: 0.2px; }
.brand-text span { color: var(--text-muted); font-size: 13px; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(229, 231, 235, 0.85);
  font-size: 12px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--accent-strong), var(--accent));
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.55);
}

.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  transition: transform var(--transition-med), background var(--transition-med), border-color var(--transition-med);
  user-select: none;
}

.btn.small { padding: 9px 12px; font-size: 13px; border-radius: 12px; }

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0px); }

.btn.ghost { background: rgba(255, 255, 255, 0.05); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.08); }

.btn.primary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(56, 189, 248, 0.65));
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.25);
}
.btn.primary:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 1), rgba(56, 189, 248, 0.75));
  border-color: rgba(147, 197, 253, 0.65);
}

main { padding: 14px 18px 18px; }

.hero {
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-subtle);
  padding: 18px;
  margin-top: 12px;
}

.hero-inner h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.4vw, 32px);
}

.hero-inner p { margin: 0; color: rgba(229, 231, 235, 0.88); max-width: 78ch; line-height: 1.5; }

.hero-callouts {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 880px) {
  .hero-callouts { grid-template-columns: 1fr 1fr; }
}

.callout {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(2, 6, 23, 0.45);
  padding: 12px 14px;
}

.callout-title { font-weight: 800; margin-bottom: 6px; }
.callout-text { color: rgba(229, 231, 235, 0.85); line-height: 1.45; }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
}

.panel {
  margin-top: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 23, 0.62);
  box-shadow: var(--shadow-subtle);
  padding: 14px;
}

.panel-head {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
}

.panel-head h3 { margin: 0; font-size: 18px; }
.muted { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  justify-content: flex-start;
}

.control {
  appearance: none;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  outline: none;
  min-width: 220px;
  transition: border-color var(--transition-med), background var(--transition-med);
}

.control:focus {
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

select.control { min-width: 170px; }

.stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
}

.stat-label { color: var(--text-muted); font-size: 12px; letter-spacing: 0.3px; text-transform: uppercase; }
.stat-value { font-weight: 900; font-size: 18px; margin-top: 4px; }

.grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.empty {
  grid-column: 1 / -1;
  padding: 12px 4px;
  color: rgba(229, 231, 235, 0.78);
}


.card {
  grid-column: span 12;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.18);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

@media (min-width: 760px) {
  .card { grid-column: span 6; }
}

@media (min-width: 1100px) {
  .card { grid-column: span 4; }
}

.thumb { position: relative; aspect-ratio: 16 / 9; background: rgba(255, 255, 255, 0.04); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(6px);
}

.badge.featured {
  border-color: rgba(147, 197, 253, 0.55);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.10), 0 10px 24px rgba(59, 130, 246, 0.12);
}

.body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 170px;
}

.title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.title h4 { margin: 0; font-size: 17px; }

.meta { color: rgba(229, 231, 235, 0.78); font-size: 13px; }
.desc { margin: 0; color: rgba(229, 231, 235, 0.88); line-height: 1.35; font-size: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.95;
}

.actions { display: flex; gap: 10px; align-items: center; }
.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 800;
  transition: transform var(--transition-med), background var(--transition-med), border-color var(--transition-med);
  user-select: none;
}
.action:hover { background: rgba(255, 255, 255, 0.10); transform: translateY(-1px); }
.action:active { transform: translateY(0px); }

.action.primary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.85), rgba(96, 165, 250, 0.35));
  border-color: rgba(96, 165, 250, 0.45);
}
.action.primary:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.98), rgba(96, 165, 250, 0.45));
  border-color: rgba(147, 197, 253, 0.65);
}

.fineprint {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(229, 231, 235, 0.70);
}

.foot {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.foot a { color: rgba(191, 219, 254, 0.95); text-decoration: none; font-weight: 700; }
.foot a:hover { text-decoration: underline; }

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

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
