/**
 * SILENT BROWSER — Unified Design System (Classic White Default + Black Theme)
 * Publisher: Silent Bot LLC
 */

:root,
html[data-theme="light"],
html:not([data-theme="dark"]) {
  --bg: #FFFFFF;
  --surface: #F5F7F6;
  --surface-elevated: #FFFFFF;
  --surface-muted: #EEF2F0;
  --text: #17231C;
  --muted: #526058;
  --text-muted: #667085;
  --brand: #08783A;
  --brand-hover: #06612E;
  --brand-2: #0A9650;
  --brand-soft: #E7F5ED;
  --brand-soft-border: #B6E3C9;
  --border: #DCE4DF;
  --shadow: 0 8px 24px rgba(23, 35, 28, 0.06);
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --info: #0369A1;
  --header-bg: rgba(255, 255, 255, 0.96);

  /* Shared aliases */
  --sb-bg: var(--bg);
  --sb-bg-alt: var(--surface);
  --sb-surface: var(--surface-elevated);
  --sb-surface-elevated: var(--surface-elevated);
  --sb-surface-muted: var(--surface-muted);
  --sb-text: var(--text);
  --sb-text-secondary: var(--muted);
  --sb-text-muted: var(--text-muted);
  --sb-brand: var(--brand);
  --sb-brand-hover: var(--brand-hover);
  --sb-brand-light: var(--brand-soft);
  --sb-brand-secondary: var(--brand-2);
  --sb-border: var(--border);
  --sb-header-bg: var(--header-bg);
  --sb-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --sb-shadow-md: var(--shadow);
}

html[data-theme="dark"] {
  --bg: #000000;
  --surface: #101010;
  --surface-elevated: #171717;
  --surface-muted: #1E1E1E;
  --text: #FFFFFF;
  --muted: #B8C2BC;
  --text-muted: #94A39D;
  --brand: #22C55E;
  --brand-hover: #16A34A;
  --brand-2: #2EE58A;
  --brand-soft: #07261B;
  --brand-soft-border: #135C41;
  --border: #262626;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
  --warn: #FBBF24;
  --warn-soft: #2A1F05;
  --info: #38BDF8;
  --header-bg: rgba(8, 8, 8, 0.96);

  --sb-bg: var(--bg);
  --sb-bg-alt: var(--surface);
  --sb-surface: var(--surface);
  --sb-surface-elevated: var(--surface-elevated);
  --sb-surface-muted: var(--surface-muted);
  --sb-text: var(--text);
  --sb-text-secondary: var(--muted);
  --sb-text-muted: var(--text-muted);
  --sb-brand: var(--brand);
  --sb-brand-hover: var(--brand-hover);
  --sb-brand-light: var(--brand-soft);
  --sb-brand-secondary: var(--brand-2);
  --sb-border: var(--border);
  --sb-header-bg: var(--header-bg);
  --sb-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.55);
  --sb-shadow-md: var(--shadow);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--brand);
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { left: 16px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (max-width: 480px) {
  .container { padding: 0 14px; }
}

/* Header & Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #061626;
  flex-shrink: 0;
}
.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text);
}
.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
nav.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
nav.primary-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
nav.primary-nav a:hover,
nav.primary-nav a.active {
  background: var(--brand-soft);
  color: var(--brand);
  text-decoration: none;
}

.menu-toggle,
.theme-toggle,
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  min-height: 42px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.menu-toggle { display: none; }
.theme-toggle:hover,
.theme-toggle-btn:hover,
.menu-toggle:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

@media (max-width: 980px) {
  .menu-toggle { display: inline-flex; }
  .nav-wrap {
    width: 100%;
    display: none;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .nav-wrap.open { display: block; }
  nav.primary-nav { flex-direction: column; }
  nav.primary-nav a { width: 100%; }
}

/* Hero */
.hero { padding: 34px 0 26px; }
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: center;
}
@media (max-width: 860px) {
  .hero-card {
    grid-template-columns: 1fr;
    padding: 22px 18px;
  }
}
.status-pill,
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-2);
}
.hero h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.hero p.lead {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 20px;
  max-width: 640px;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
}
.search-box input {
  flex: 1 1 200px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  padding: 0 12px;
}
.search-box select {
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--brand);
  color: #FFFFFF;
}
html[data-theme="dark"] .btn-primary { color: #051A0D; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 13px; }

.hero-visual {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.hero-visual img {
  width: 112px;
  height: 112px;
  border-radius: 24px;
  object-fit: contain;
  padding: 12px;
  border: 1px solid var(--border);
  background: #061626;
}
.metric-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.metric-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}
.metric-box strong {
  display: block;
  font-size: 14px;
  color: var(--brand);
}
.metric-box span {
  font-size: 12px;
  color: var(--muted);
}

/* Sections & Grids */
section { padding: 34px 0; }
.section-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}
.section-heading {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  margin-bottom: 14px;
}
.section-intro {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 18px;
  max-width: 780px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--sb-shadow-sm);
}
.card-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-soft-border);
  border-radius: 8px;
  padding: 3px 9px;
  margin-bottom: 10px;
}
.badge-warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: var(--warn);
}
.card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.card p,
.card li {
  font-size: 14px;
  color: var(--muted);
}
.card ul {
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

/* Live Daily News & Trending GitHub Feed */
.feed-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.feed-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}
.feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sb-shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.feed-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}
.feed-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feed-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.feed-media-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 16px;
  text-align: center;
  background: linear-gradient(135deg, var(--surface-muted), var(--brand-soft));
  color: var(--brand);
  font-weight: 700;
  font-size: 12px;
}
.feed-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.feed-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.feed-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-soft-border);
}
.feed-source-pill.github {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--border);
}
.feed-metric {
  font-size: 11px;
  color: var(--muted);
}
.feed-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.feed-summary {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.feed-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.feed-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
.feed-section-block {
  margin-top: 26px;
  padding: 22px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--sb-shadow-sm);
}
.feed-section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.feed-section-header h3 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.feed-section-sub {
  font-size: 13px;
  color: var(--muted);
}
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
}
.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}
html[data-theme="dark"] .page-btn.active {
  color: #051A0D;
}
.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.network-check-card {
  margin-top: 20px;
}

/* Platform Selector & Download Center */
.os-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.os-tab {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.os-tab.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  display: grid;
  gap: 18px;
}
.download-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.download-head h3 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.download-head p { font-size: 14px; color: var(--muted); max-width: 640px; }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.meta-item {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.meta-item span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.meta-item strong {
  font-size: 14px;
  color: var(--text);
  word-break: break-word;
}
pre.code-block {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-elevated);
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  text-align: left;
}
th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
thead th {
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
tbody tr:last-child td { border-bottom: none; }
.tag-yes { color: var(--brand); font-weight: 700; }
.tag-warn { color: var(--warn); font-weight: 700; }

/* FAQ */
.faq-list { display: grid; gap: 10px; }
details.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
}
details.faq-item summary {
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 32px;
}
details.faq-item summary::after {
  content: "+";
  font-size: 18px;
  color: var(--brand);
  font-weight: 700;
}
details.faq-item[open] summary::after { content: "−"; }
details.faq-item p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

/* Footer */
footer,
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0;
  margin-top: 32px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
footer a,
.site-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
footer a:hover,
.site-footer a:hover { text-decoration: underline; }
