/* Hub styles.
 *
 * The tokens below are duplicated, in spirit, in each demo's own stylesheet.
 * That is deliberate -- see ../README.md § "No shared code". A token file that
 * four projects import is exactly what makes a project un-liftable.
 */

:root {
  --bg: #fbfaf8;
  --panel: #ffffff;
  --ink: #1a1a18;
  --muted: #6b6a66;
  --line: #e5e2dc;
  --accent: #3d5afe;
  --up: #17a673;
  --down: #b9b6b0;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14140f;
    --panel: #1c1c19;
    --ink: #f2f0eb;
    --muted: #9c9a93;
    --line: #2d2d28;
    --down: #55534e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem) 4rem;
}

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

.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 6vw, 2.9rem);
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 0 2.5rem;
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.05rem;
}

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

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

.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.card::before {
  content: "";
  display: block;
  height: 3px;
  width: 2.5rem;
  border-radius: 2px;
  background: var(--accent);
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -12px color-mix(in oklab, var(--accent) 55%, transparent);
}

.card.down { opacity: 0.62; }
.card.down:hover { transform: none; box-shadow: none; }

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.kind {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--down);
}

.card:not(.down) .dot { background: var(--up); }

.card h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

/* -------------------------------------------------- comparison */

.compare {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.compare h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.compare > p {
  margin: 0 0 1.5rem;
  max-width: 44rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Wide content scrolls inside its own box. The page body must never scroll
 * horizontally. */
.scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

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

th, td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

thead th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

tbody th {
  font-weight: 500;
  color: var(--muted);
}

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: none; }

.proof {
  margin: 1.5rem 0 0;
  max-width: 46rem;
  color: var(--muted);
  font-size: 0.9rem;
}

code {
  padding: 0.1rem 0.35rem;
  border-radius: 5px;
  background: color-mix(in oklab, var(--ink) 8%, transparent);
  font-family: var(--mono);
  font-size: 0.85em;
}

/* -------------------------------------------------- foot */

.foot {
  margin-top: 3rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.error { color: #c0392b; }

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}
