/*
 * Shared styling for the static content pages that sit beside the app.
 *
 * Deliberately dependency-free: these files live in public/ and are copied
 * verbatim by Vite, so they must not rely on anything the bundler produces.
 * System fonts only — a content page that has to wait on a webfont before it
 * paints is a content page that loses the visitor.
 *
 * The `abc-*` rules mirror src/abc.css. The neutral prefix is deliberate; the
 * reasoning is at the top of src/ui/abc.ts.
 */

:root {
  --bg-0: #0a0c11;
  --bg-1: #10131b;
  --bg-2: #171b26;
  --text: #edf0f7;
  --text-dim: #b3bccd;
  --text-faint: #8b93a6;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #6ea8fe;
  --accent-soft: rgba(110, 168, 254, 0.14);
  --radius: 14px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-0: #f2f3f7;
    --bg-1: #ffffff;
    --bg-2: #e9ebf2;
    --text: #171a22;
    --text-dim: #434a5c;
    --text-faint: #6b7285;
    --border: rgba(12, 16, 28, 0.13);
    --border-strong: rgba(12, 16, 28, 0.24);
    --accent: #2f6fed;
    --accent-soft: rgba(47, 111, 237, 0.12);
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 18% -8%, rgba(110, 168, 254, 0.1), transparent 58%),
    var(--bg-0);
  color: var(--text);
  font:
    16.5px/1.68 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  padding: 0 20px calc(56px + env(safe-area-inset-bottom));
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- Masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 0 4px;
  flex-wrap: wrap;
}

.masthead a.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 17px;
}

.masthead img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
}

.masthead nav {
  margin-left: auto;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14.5px;
}

.masthead nav a {
  color: var(--text-dim);
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Type ---------- */

.crumbs {
  font-size: 13px;
  color: var(--text-faint);
  padding: 14px 0 0;
}

.crumbs a {
  color: var(--text-faint);
}

h1 {
  font-size: clamp(30px, 5.6vw, 42px);
  line-height: 1.14;
  letter-spacing: -0.024em;
  margin: 16px 0 12px;
}

h2 {
  font-size: clamp(21px, 3.4vw, 26px);
  line-height: 1.25;
  letter-spacing: -0.016em;
  margin: 42px 0 10px;
}

h3 {
  font-size: 17.5px;
  letter-spacing: -0.008em;
  margin: 26px 0 6px;
}

p,
li {
  color: var(--text-dim);
}

.lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text);
}

a {
  color: var(--accent);
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin: 6px 0;
}

strong {
  color: var(--text);
  font-weight: 620;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 42px 0 0;
}

/* ---------- Blocks ---------- */

.cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--accent);
  color: #08101f;
  font-weight: 640;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 999px;
  margin: 10px 0 6px;
}

.cta:hover {
  filter: brightness(1.08);
}

.note {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 24px 0;
}

.note p {
  margin: 0;
  font-size: 15px;
}

.cards {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 20px 0 8px;
  padding: 0;
  list-style: none;
}

.cards li {
  margin: 0;
}

.cards a {
  display: block;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  background: var(--bg-1);
  text-decoration: none;
  color: var(--text);
}

.cards a:hover {
  border-color: var(--border-strong);
}

.cards b {
  display: block;
  margin-bottom: 3px;
  font-size: 15.5px;
}

.cards span {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

/* Colorblindness demo strip — pure CSS, no image request. */
.strip {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 6px 0 4px;
  height: 46px;
}

.strip i {
  flex: 1;
}

.strip-label {
  font-size: 13px;
  color: var(--text-faint);
  margin: 0 0 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 15px;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

th {
  color: var(--text);
  font-weight: 620;
}

.scroll-x {
  overflow-x: auto;
}

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

footer {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-faint);
}

footer nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

footer p {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-faint);
}

/* ---------- abc (affiliate) ----------
   Neutral prefix on purpose — see src/ui/abc.ts. The visible #ad marker, the
   disclosure paragraph and rel="sponsored nofollow noopener" are the honest
   half and are never obfuscated. */

.abc-slot {
  display: block;
  margin: 26px 0;
}

.abc-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(115deg, var(--accent-soft), transparent 60%), var(--bg-2);
  color: var(--text);
  text-decoration: none;
}

.abc-card:hover {
  border-color: var(--border-strong);
}

.abc-dot {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: conic-gradient(
    #ff5c5c,
    #ffb347,
    #ffe66d,
    #6ee7a0,
    #23d9d9,
    #6ea8fe,
    #a78bfa,
    #ff6ec7,
    #ff5c5c
  );
}

.abc-card-body {
  min-width: 0;
}

.abc-card-intro {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
}

.abc-card-lead {
  display: block;
  font-weight: 640;
  font-size: 15.5px;
  letter-spacing: -0.006em;
}

.abc-mark {
  font-size: 0.85em;
  color: var(--text-dim);
  font-weight: 600;
}

.abc-fine {
  margin: 5px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-faint);
}

.abc-support {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  background: var(--bg-2);
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
}

.abc-support:hover {
  border-color: var(--border-strong);
}

/* ---------- Sister site (ChromaMatch) ----------
   The author's other color site. NOT an ad — no #ad marker, no sponsored rel.
   The neutral `sbs` prefix is the same defence the `abc` blocks use: a block
   named "promo" or "cross-sell" is hidden on sight by generic cosmetic filter
   rules, and this is an honest sibling link that should survive them. */

/* Marked in the masthead so it reads as a different site, not another page. */
.masthead nav a.sbs-nav {
  color: var(--text);
  font-weight: 600;
}

.masthead nav a.sbs-nav::after {
  content: ' ↗';
  color: var(--text-faint);
  font-weight: 400;
}

.sbs-panel {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 26px 0;
  padding: 16px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(115deg, var(--accent-soft), transparent 62%), var(--bg-1);
}

.sbs-panel .sbs-dot {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  /* A hue sweep instead of a logo request — this page loads no images. */
  background: conic-gradient(#ff5c5c, #ffe66d, #6ee7a0, #6ea8fe, #a78bfa, #ff5c5c);
}

.sbs-body {
  min-width: 0;
}

.sbs-panel b {
  display: block;
  font-size: 16.5px;
  margin-bottom: 4px;
}

.sbs-panel p {
  margin: 0 0 12px;
  font-size: 14.5px;
  color: var(--text-dim);
}

.sbs-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--text);
  font-weight: 620;
  font-size: 14.5px;
  text-decoration: none;
}

.sbs-cta:hover {
  background: var(--accent-soft);
}
