/* resources.inherence.dev — matches inherence.dev.
   Tokens read off the live site: cream #f6f4ed, cobalt #2536ef, Jokker
   display, Geist Mono for labels. Everything is cobalt on cream; there is
   no second text colour in this brand. */

:root {
  color-scheme: light;
  --cream:  #f6f4ed;
  --cobalt: #2536ef;
  --card:   #fbfaf6;
  --rule:   rgba(37, 54, 239, 0.18);
  --hush:   rgba(37, 54, 239, 0.62);

  --ff-display: 'Jokker', 'Inter', system-ui, -apple-system, sans-serif;
  --ff-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 68ch;
  --pad: clamp(1.15rem, 4vw, 2.75rem);
}

/* Jokker — licensed from Displaay Type Foundry, self-hosted because it is
   not on any public CDN. Only the four faces this site actually uses are
   shipped: distributing the rest of a licensed family for no reason is
   both wasteful and worse practice. font-display:swap so text is readable
   immediately rather than invisible while the face downloads. */
@font-face {
  font-family: 'Jokker';
  src: url('/fonts/jokker-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Jokker';
  src: url('/fonts/jokker-medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Jokker';
  src: url('/fonts/jokker-semibold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Jokker';
  src: url('/fonts/jokker-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--cream);
  color: var(--cobalt);
  font-family: var(--ff-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(100% - 2 * var(--pad), 1180px); margin-inline: auto; }
a { color: inherit; }

/* Display type: uppercase, tight tracking, tight leading — the site's
   defining typographic move. */
.display {
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.95;
}

.eyebrow {
  font-family: var(--ff-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hush);
}

/* ─── NAV ─────────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 244, 237, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  width: min(100% - 2 * var(--pad), 1180px);
  margin-inline: auto;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0.85rem 0;
}
.nav-brand { display: block; margin-right: auto; color: var(--cobalt); }
.nav-brand svg { display: block; width: 132px; height: auto; }
.nav-links { display: flex; gap: 1.4rem; align-items: center; }
.nav-links a {
  font-size: 0.84rem; font-weight: 500; text-decoration: none;
  color: var(--cobalt); opacity: 0.85;
}
.nav-links a:hover { opacity: 1; }
.pill {
  font-size: 0.8rem; font-weight: 600; text-decoration: none;
  color: var(--cobalt); border: 1px solid var(--cobalt);
  padding: 0.42rem 0.95rem; border-radius: 999px; white-space: nowrap;
}
.pill:hover { background: var(--cobalt); color: var(--cream); }
@media (max-width: 820px) { .nav-links { display: none; } }

/* ─── HERO ────────────────────────────────────────────────────── */

.hero { padding: clamp(3rem, 9vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero h1 {
  font-size: clamp(2.4rem, 7.5vw, 5rem);
  margin: 0.9rem 0 1.1rem;
}
.hero-dek {
  max-width: 54ch; font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--hush); margin: 0;
}

/* ─── LISTING ─────────────────────────────────────────────────── */

.cards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  padding-bottom: clamp(3rem, 8vw, 5rem);
}
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.card:hover { border-color: var(--cobalt); transform: translateY(-2px); }
.card-link {
  display: flex; flex-direction: column; height: 100%;
  padding: 1.4rem 1.4rem 1.25rem; text-decoration: none;
}
.card-meta { display: flex; gap: 0.55rem; align-items: center; margin-bottom: 1rem; }
.card h2 {
  font-size: 1.28rem; margin: 0 0 0.65rem;
  text-transform: uppercase; font-weight: 500;
  letter-spacing: -0.015em; line-height: 1.02;
}
.card-dek { font-size: 0.88rem; color: var(--hush); margin: 0 0 1.1rem; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag {
  font-family: var(--ff-mono); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--rule); color: var(--hush);
}
.card-cta { font-family: var(--ff-mono); font-size: 0.7rem; margin-top: 1rem; }
.empty { font-family: var(--ff-mono); color: var(--hush); }

/* ─── ARTICLE ─────────────────────────────────────────────────── */

.post-hero {
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1.75rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}
.post-back {
  display: inline-block; font-family: var(--ff-mono);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  text-decoration: none; color: var(--hush); margin-bottom: 1.75rem;
}
.post-back:hover { color: var(--cobalt); }
.post-hero h1 {
  font-size: clamp(1.9rem, 5.2vw, 3.4rem);
  margin: 0.85rem 0 1rem; max-width: 20ch;
}
.post-dek {
  max-width: var(--measure); color: var(--hush);
  font-size: clamp(0.95rem, 2vw, 1.05rem); margin: 0 0 1.1rem;
}
.source-note {
  font-family: var(--ff-mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--hush); margin: 1.4rem 0 0;
  padding-top: 1rem; border-top: 1px solid var(--rule);
  max-width: var(--measure);
}
.source-note a { text-decoration: underline; text-underline-offset: 3px; }

/* Long-form body. Cobalt on cream, as everywhere in this brand, but set
   larger and looser than the marketing pages — those run in short blocks,
   these run 2,500 words. */
.prose {
  max-width: var(--measure);
  padding: clamp(2rem, 5vw, 3.25rem) 0;
  font-size: 1.05rem;
  line-height: 1.68;
}
.prose > * + * { margin-top: 1.2em; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  text-transform: uppercase; font-weight: 500;
  letter-spacing: -0.018em; line-height: 1.02;
}
.prose h1, .prose h2 { font-size: clamp(1.45rem, 3.4vw, 2rem); margin-top: 2.5em; }
.prose h3 { font-size: clamp(1.15rem, 2.6vw, 1.4rem); margin-top: 2.1em; }
.prose h4 { font-size: 1.05rem; margin-top: 1.9em; }
.prose h1 + *, .prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.45em; }
.prose blockquote {
  margin-left: 0; padding: 0.15em 0 0.15em 1.25em;
  border-left: 2px solid var(--cobalt); color: var(--hush);
}
.prose code {
  font-family: var(--ff-mono); font-size: 0.86em;
  background: var(--card); border: 1px solid var(--rule);
  padding: 0.1em 0.34em; border-radius: 3px;
}
.prose pre {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: 8px; padding: 1rem; overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: 0.82rem; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
.prose table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
  display: block; overflow-x: auto;
}
.prose th, .prose td {
  text-align: left; padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.prose th {
  font-family: var(--ff-mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.pager {
  display: flex; justify-content: space-between; gap: 1.5rem;
  max-width: var(--measure);
  padding: 1.5rem 0 4.5rem; border-top: 1px solid var(--rule);
}
.pager a {
  font-family: var(--ff-mono); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  text-decoration: none; color: var(--hush); max-width: 45%;
}
.pager a:hover { color: var(--cobalt); }
.pager .next { text-align: right; }

/* ─── FOOTER ──────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--rule); padding: 2.5rem 0 3rem; }
.footer-inner {
  display: flex; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap; align-items: flex-start;
}
.footer svg { width: 118px; height: auto; display: block; }
.footer-links { display: flex; gap: 1.3rem; }
.footer-links a {
  font-family: var(--ff-mono); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.07em;
  text-decoration: none; color: var(--hush);
}
.footer-links a:hover { color: var(--cobalt); }

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