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

:root {
  --bg: #0f0f1a;
  --bg-surface: #181830;
  --bg-elev: #1e1e3a;
  --text: #e0e0e8;
  --text-muted: #8888a0;
  --orange: #f5a623;
  --border: #2a2a48;

  /* One accent for the whole site: links, buttons, badges, hover borders. */
  --accent: #3dba4e;
  --accent-hover: #4dd660;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand:hover { text-decoration: none; color: var(--text); }
.brand-star { color: var(--orange); margin-left: 0.1em; }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.95rem; }
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* ---------- shell ---------- */

.content {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
  flex: 1;
}

.content > section { margin-top: 4rem; }

.section-title {
  color: var(--orange);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.eyebrow {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}

.lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 62ch;
}

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

.hero { text-align: center; padding-top: 4rem; }
.hero .lede { margin: 1.25rem auto 0; }

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-top: 0.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.75rem;
}

.hero .hero-actions { justify-content: center; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  background: var(--accent);
  color: #0b0b14;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.btn:hover { background: var(--accent-hover); color: #0b0b14; text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover { background: var(--bg-elev); color: var(--text); }

.pill {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- product rows ----------
   One full-width row per product rather than a fixed-column grid: any number of
   products stacks without leaving an orphan in a half-empty last row, and rows
   can't end up different heights the way cards did. */

.product-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.product-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem;
  transition: border-color 0.2s ease;
}

.product-row:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.product-row.has-shot {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}

/* Zig-zag, so a longer list doesn't read as the same block repeated.
   The class is set server-side; see the comment in render::index. */
.product-row.shot-left .product-shot { order: -1; }

.product-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

.product-info p { max-width: 52ch; }

.row-logo { display: block; }
.row-logo img { max-height: 76px; width: auto; }

.product-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.product-tagline {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.product-summary { color: var(--text-muted); font-size: 0.95rem; }

.product-shot {
  display: block;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.product-shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease;
}

.product-shot:hover img { transform: scale(1.03); }

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

.product-hero { padding-top: 3rem; }

.product-logo {
  max-width: 380px;
  margin-bottom: 1.5rem;
}

.product-hero .eyebrow { margin-bottom: 0.75rem; }

/* ---------- features ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
}

.feature {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
}

.feature h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.feature p { color: var(--text-muted); font-size: 0.92rem; }

/* ---------- screenshot gallery ---------- */

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.shot {
  position: relative;
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
}

.shot:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  text-decoration: none;
}

.shot img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.shot:hover img { transform: scale(1.03); }

.shot-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.6rem 0.85rem;
  background: linear-gradient(to top, rgba(9, 9, 18, 0.92), rgba(9, 9, 18, 0));
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}

/* CSS-only lightbox: the overlay is shown when its id is the URL fragment. */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 3rem 1.5rem;
  align-items: center;
  justify-content: center;
}

.lightbox:target { display: flex; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 14, 0.92);
  backdrop-filter: blur(4px);
}

.lightbox figure {
  position: relative;
  max-width: min(1200px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lightbox figure img {
  max-height: 78vh;
  width: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.lightbox figcaption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.lightbox .counter { color: var(--text-muted); opacity: 0.65; margin-left: 0.5rem; }

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(24, 24, 48, 0.9);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-nav:hover { background: var(--bg-elev); color: var(--accent); text-decoration: none; }

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-nav.prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ---------- downloads ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead th {
  text-align: left;
  padding: 0.6rem 1rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

thead th.right { text-align: right; }

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:nth-child(even) { background: var(--bg-elev); }
tbody td { padding: 0.7rem 1rem; }

td.filename a {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  word-break: break-all;
}

td.size { color: var(--text-muted); text-align: right; white-space: nowrap; }
td.arch, td.type, td.version { white-space: nowrap; }
td.version { color: var(--text-muted); font-family: "SFMono-Regular", Consolas, monospace; }

.sig-link { color: var(--text-muted); font-size: 0.78rem; margin-left: 0.4rem; }
.sig-link:hover { color: var(--text); }

/* ---------- panels ---------- */

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}

.panel summary { color: var(--text-muted); cursor: pointer; font-size: 0.95rem; }
.panel[open] summary { color: var(--text); }

.panel pre {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.85rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

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

.thanks p { color: var(--text-muted); margin-bottom: 0.75rem; max-width: 70ch; }

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

@media (max-width: 760px) {
  .product-row.has-shot { grid-template-columns: 1fr; }
  /* Keep the reading order identical once rows are stacked. */
  .product-row.shot-left .product-shot { order: 0; }
}

@media (max-width: 600px) {
  .content { padding-bottom: 3rem; }
  .content > section { margin-top: 2.75rem; }
  .hero { padding-top: 2.5rem; }
  .product-hero { padding-top: 2rem; }
  .product-logo { max-width: 260px; }
  .product-row { padding: 1.25rem; }
  .row-logo img { max-height: 60px; }
  table { font-size: 0.85rem; }
  thead th, tbody td { padding: 0.5rem 0.6rem; }
  td.type, thead th:first-child { display: none; }
  .lightbox { padding: 1rem 0.5rem; }
  .lightbox-nav { width: 2.25rem; height: 2.25rem; }
}

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