/* ==========================================================================
   InstallShelf — stylesheet
   Single-page software directory. Light theme, system fonts, no frameworks.
   ========================================================================== */

:root {
  --bg:            #f6f7f9;
  --surface:       #ffffff;
  --surface-alt:   #eef1f5;
  --text:          #0f1620;
  --text-muted:    #5a6673;
  --text-faint:    #8b95a1;
  --border:        #e2e6ec;
  --border-strong: #ccd3dc;
  --accent:        #2f5cff;
  --accent-ink:    #1d3fd1;
  --accent-wash:   #eef2ff;
  --sponsored:     #a45c00;
  --sponsored-wash:#fff6e6;
  --pick:          #0b7a5a;
  --pick-wash:     #e8f7f1;
  --radius-sm:     8px;
  --radius:        12px;
  --radius-lg:     18px;
  --shadow-sm:     0 1px 2px rgba(15, 22, 32, .05);
  --shadow:        0 4px 16px -4px rgba(15, 22, 32, .10), 0 1px 3px rgba(15, 22, 32, .05);
  --shadow-lg:     0 18px 40px -16px rgba(15, 22, 32, .22);
  --maxw:          1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          "Noto Sans", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

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

img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Header -------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 24px;
  min-height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 17px; color: var(--text);
  letter-spacing: -.01em; text-decoration: none; flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  background: linear-gradient(140deg, #2f5cff, #6b8cff);
  display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 800; line-height: 1;
}
.brand small {
  display: block; font-weight: 500; font-size: 11px;
  color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase;
  margin-top: -2px;
}

.header-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.header-nav a {
  padding: 7px 12px; border-radius: 999px; font-size: 14px;
  color: var(--text-muted); font-weight: 500; white-space: nowrap;
}
.header-nav a:hover { background: var(--surface-alt); color: var(--text); text-decoration: none; }

/* ---------- Search -------------------------------------------------------- */

.search-bar { padding: 18px 0 0; }
.search-field { position: relative; max-width: 560px; margin: 0 auto; }
.search-field input {
  width: 100%; padding: 14px 16px 14px 46px;
  font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 999px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search-field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}
.search-field svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: var(--text-faint); pointer-events: none;
}
.search-hint {
  text-align: center; font-size: 13px; color: var(--text-faint);
  margin: 8px 0 0; min-height: 20px;
}

/* ---------- Hero ---------------------------------------------------------- */

.hero { padding: 40px 0 8px; text-align: center; }
.hero h1 {
  font-size: clamp(28px, 4.6vw, 44px); line-height: 1.16;
  letter-spacing: -.025em; margin: 0 0 16px; font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--accent-ink); }
.hero p.lede {
  font-size: clamp(15px, 1.7vw, 18px); color: var(--text-muted);
  max-width: 640px; margin: 0 auto 26px;
}

.promises {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin: 0 auto 8px; padding: 0; list-style: none;
}
.promises li {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px 7px 11px;
  font-size: 13.5px; font-weight: 500; color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.promises li b { color: var(--text); font-weight: 650; }
.promises svg { width: 15px; height: 15px; flex: 0 0 auto; }

.disclaimer-note {
  max-width: 620px; margin: 22px auto 0; padding: 12px 16px;
  font-size: 13px; line-height: 1.55; color: var(--text-muted);
  background: var(--surface-alt); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.disclaimer-note strong { color: var(--text); }

/* ---------- Sections ------------------------------------------------------ */

section { padding: 46px 0 6px; }
.section-head { margin-bottom: 22px; }
.section-head h2 {
  font-size: clamp(21px, 2.6vw, 27px); letter-spacing: -.02em;
  margin: 0 0 6px; font-weight: 750;
}
.section-head p { margin: 0; color: var(--text-muted); font-size: 15px; max-width: 720px; }
.eyebrow {
  display: inline-block; font-size: 11.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink);
  margin-bottom: 9px;
}

/* ---------- Ad slots ------------------------------------------------------ */

.ad-slot {
  display: grid; place-items: center; text-align: center;
  background: repeating-linear-gradient(45deg, #fbfcfd, #fbfcfd 10px, #f4f6f9 10px, #f4f6f9 20px);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-faint); font-size: 12px; line-height: 1.5;
  margin: 34px auto; padding: 10px;
}
.ad-slot span { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.ad-leaderboard { min-height: 96px; max-width: 970px; }
.ad-rectangle   { min-height: 254px; max-width: 336px; }
.ad-inline      { min-height: 96px; max-width: 728px; }
.ad-slot em { font-style: normal; display: block; opacity: .75; margin-top: 3px; }

/* ---------- Scenario cards ------------------------------------------------ */

.scenario-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}
@media (max-width: 900px) {
  .scenario-grid { grid-template-columns: 1fr; }
}
.scenario {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.scenario:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }
.scenario h3 {
  margin: 0 0 8px; font-size: 18px; letter-spacing: -.015em; font-weight: 700;
}
.scenario .lede { margin: 0 0 14px; font-size: 14.5px; color: var(--text-muted); }
.scenario .order {
  margin: 0 0 18px; padding: 11px 13px; font-size: 13px; line-height: 1.5;
  background: var(--accent-wash); border-radius: var(--radius-sm);
  color: var(--text-muted); border-left: 3px solid var(--accent);
}
.scenario .order b { color: var(--text); font-weight: 650; }
.scenario-list {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
  counter-reset: step;
}
.scenario-list li { counter-increment: step; }
.scenario-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 550; color: var(--text);
}
.scenario-list a:hover { background: var(--surface-alt); text-decoration: none; }
.scenario-list a::before {
  content: counter(step);
  flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  background: var(--surface-alt); color: var(--text-faint);
}
.scenario-list .mini-tile {
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto;
  display: grid; place-items: center; overflow: hidden;
}
.scenario-list .mini-tile img { width: 15px; height: 15px; object-fit: contain; }
.scenario-list .mono-mini {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 9px; font-weight: 800; color: #fff; letter-spacing: -.02em;
}
.scenario-foot {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-faint);
}

/* ---------- Category navigation ------------------------------------------- */

.cat-nav {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 20px 0 4px; margin-bottom: 4px;
}
.cat-nav a {
  font-size: 13.5px; font-weight: 550; padding: 6px 13px;
  border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.cat-nav a:hover, .cat-nav a.is-active {
  background: var(--text); border-color: var(--text); color: #fff; text-decoration: none;
}

/* ---------- Category blocks ----------------------------------------------- */

.category { padding: 30px 0 4px; scroll-margin-top: 90px; }
.category-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.category-head h3 {
  margin: 0; font-size: 20px; letter-spacing: -.018em; font-weight: 750;
}
.category-head .count {
  font-size: 12px; font-weight: 650; color: var(--text-faint);
  background: var(--surface-alt); padding: 2px 9px; border-radius: 999px;
  font-family: var(--mono);
}
.category-head p {
  flex: 1 1 100%; margin: 0; font-size: 14.5px; color: var(--text-muted);
  max-width: 760px;
}

.card-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

/* ---------- Software card ------------------------------------------------- */

.card {
  position: relative;
  display: flex; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.card:hover {
  box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px);
}
.card.is-filtered { display: none; }

.card-icon {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 11px;
  background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.card-icon img { width: 27px; height: 27px; object-fit: contain; }
.card-icon .mono {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; letter-spacing: -.03em; color: #fff;
}

.card-body { min-width: 0; flex: 1 1 auto; }
.card-title-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 3px;
}
.card-title-row h4 {
  margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.012em;
}
.card-note {
  margin: 7px 0 11px; font-size: 13.8px; line-height: 1.58; color: var(--text-muted);
}
.card-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.card-meta {
  font-size: 11.5px; color: var(--text-faint); font-family: var(--mono);
  letter-spacing: -.01em;
}
.card-plat { display: flex; gap: 5px; margin-left: auto; }
.card-plat span {
  font-size: 10.5px; font-weight: 650; letter-spacing: .03em;
  color: var(--text-faint); background: var(--surface-alt);
  border-radius: 4px; padding: 2px 6px; text-transform: uppercase;
}
.card-cta {
  flex: 1 1 100%; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 650; color: var(--accent-ink);
  margin-top: 2px;
}
.card-cta svg { width: 13px; height: 13px; fill: currentColor; }
.card-cta:hover { text-decoration: underline; }

.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  text-transform: uppercase;
}
.badge-pick { background: var(--pick-wash); color: var(--pick); }
.badge-sponsored { background: var(--sponsored-wash); color: var(--sponsored); }

.sponsored-flag {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--sponsored);
  border: 1px solid #f0d9a8; background: var(--sponsored-wash);
  padding: 1px 6px; border-radius: 4px;
}

/* ---------- Empty state --------------------------------------------------- */

#no-results {
  display: none; text-align: center; padding: 60px 20px;
  color: var(--text-muted); font-size: 15px;
}
#no-results.is-visible { display: block; }

/* ---------- Footer -------------------------------------------------------- */

.site-footer {
  margin-top: 60px; padding: 44px 0 56px;
  background: var(--surface); border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid; gap: 30px;
  grid-template-columns: minmax(240px, 1.6fr) repeat(auto-fit, minmax(140px, 1fr));
}
.site-footer h5 {
  margin: 0 0 11px; font-size: 12px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-faint); font-weight: 700;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { font-size: 14px; color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.footer-about p { font-size: 13.8px; color: var(--text-muted); margin: 0 0 12px; max-width: 380px; }
.footer-legal {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-faint); line-height: 1.65;
}
.footer-legal p { margin: 0 0 9px; }
.footer-legal strong { color: var(--text-muted); }

/* ---------- Legal / content pages ----------------------------------------- */

.doc { max-width: 780px; margin: 0 auto; padding: 46px 20px 80px; }
.doc h1 { font-size: clamp(26px, 3.6vw, 34px); letter-spacing: -.022em; margin: 0 0 10px; }
.doc .doc-meta { color: var(--text-faint); font-size: 13.5px; margin: 0 0 30px; }
.doc h2 {
  font-size: 19px; margin: 34px 0 10px; letter-spacing: -.012em; font-weight: 700;
}
.doc h3 { font-size: 16px; margin: 24px 0 8px; font-weight: 650; }
.doc p, .doc li { font-size: 15px; color: #26313d; line-height: 1.72; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc .callout {
  background: var(--accent-wash); border-left: 3px solid var(--accent);
  padding: 14px 18px; border-radius: var(--radius-sm); margin: 22px 0;
}
.doc .callout p { margin: 0; font-size: 14.5px; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.doc th, .doc td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); }

.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; margin-bottom: 24px;
}

/* ---------- Responsive ---------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 760px) {
  /* Four nav links plus the wordmark need ~410px. Collapse in two stages so a
     phone-width header never pushes the document into a horizontal scroll. */
  .header-nav a.hide-md { display: none; }
  .hero { padding-top: 28px; }
  .card-grid { grid-template-columns: 1fr; }
  .card { flex-direction: row; }
  section { padding: 36px 0 6px; }
  .site-footer { padding-bottom: 40px; }

  /* minmax(240px, …) plus a 140px column cannot fit a phone: the row would be
     at least 380px wide and push the whole document sideways. */
  .footer-grid { grid-template-columns: 1fr; }

  /* Stack legal tables so wide comparison rows never force a horizontal scroll. */
  .doc table, .doc tbody, .doc tr, .doc th, .doc td { display: block; width: 100%; }
  .doc tr {
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px; padding-bottom: 10px;
  }
  .doc tr:last-child { border-bottom: 0; }
  .doc th { border: 0; padding: 0 0 3px; }
  .doc td { border: 0; padding: 3px 0; }
}

@media (max-width: 420px) {
  .card-plat { display: none; }
}

@media (max-width: 520px) {
  .header-nav a.hide-sm { display: none; }
  .brand small { display: none; }
  .site-header .wrap { gap: 12px; }
}
