/* blog.endo.cash — static blog styles.
 * Pure white + black, matching the apex landing.
 * No rounded corners. Hard borders. System fonts. Tabular numbers.
 */

:root {
  --bg:    #ffffff;
  --paper: #ffffff;
  --ink:   #000000;
  --muted: #5a5a5a;
  --line:  #000000;
  --max:   1600px;
  --pad-x: clamp(18px, 4.5vw, 80px);
  --sans:  ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", "Roboto Mono", monospace;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }

.page {
  width: min(100%, var(--max));
  margin: 0 auto;
  background: var(--paper);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Topbar (matches apex) ─── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 72px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
}

.logo {
  display: flex;
  align-items: center;
  padding: 0 22px;
  border-right: 1px solid var(--line);
  font: 900 16px/1 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav {
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  overflow: auto;
}

.nav a {
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-left: 1px solid var(--line);
  font: 800 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background .14s ease, color .14s ease;
}

.nav a:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav .launch {
  background: var(--ink);
  color: var(--paper);
}

.nav .launch:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ─── Content ─── */

.content {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 56px var(--pad-x) 96px;
}

.heading {
  font: 900 12px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

/* ─── Post listing ─── */

.post-list {
  list-style: none;
}

.post-listing-item {
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}

.post-listing-link {
  font: 700 22px/1.3 var(--sans);
  color: var(--ink);
  display: block;
  letter-spacing: -.005em;
}

.post-listing-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.post-listing-meta,
.post-meta {
  color: var(--muted);
  font: 800 11px var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: 8px;
}

.post-listing-summary {
  color: var(--ink);
  margin-top: 10px;
  font: 400 15px/1.65 var(--sans);
}

.tags {
  margin-left: 8px;
}

.tag {
  color: var(--muted);
  text-decoration: none;
}

.tag:hover {
  color: var(--ink);
}

/* ─── Single post ─── */

.post {
  border: 1px solid var(--line);
  background: var(--paper);
}

.post-head {
  padding: 32px 28px;
  border-bottom: 1px solid var(--line);
}

.post-title {
  font: 700 clamp(28px, 4vw, 40px)/1.1 var(--sans);
  letter-spacing: -.01em;
  color: var(--ink);
}

.post-body {
  padding: 32px 28px;
  color: var(--ink);
  font: 400 16px/1.75 var(--sans);
}

.post-body h1,
.post-body h2,
.post-body h3 {
  margin: 32px 0 14px;
  letter-spacing: -.005em;
}

.post-body h1 { font: 700 28px var(--sans); }
.post-body h2 { font: 700 22px var(--sans); }
.post-body h3 { font: 700 18px var(--sans); }

.post-body p {
  margin-bottom: 14px;
  color: var(--ink);
}

.post-body a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-body code {
  font: 13px var(--mono);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1px 5px;
}

.post-body pre {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 14px;
  overflow-x: auto;
  margin-bottom: 14px;
}

.post-body pre code {
  border: none;
  padding: 0;
  background: none;
}

.post-body blockquote {
  border-left: 3px solid var(--ink);
  padding-left: 14px;
  color: var(--muted);
  margin: 14px 0;
}

.post-body ul,
.post-body ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

/* ─── Footer ─── */

.footer {
  border-top: 1px solid var(--line);
  padding: 28px var(--pad-x);
  background: var(--ink);
  color: var(--paper);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 4vw, 40px);
}

.footer-links a {
  font: 900 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper);
}

.footer-links a:hover { text-decoration: underline; }

/* ─── Responsive ─── */

@media (max-width: 1120px) {
  .topbar { height: auto; grid-template-columns: 1fr; }
  .logo {
    justify-content: center;
    height: 64px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; }
  .nav a {
    height: 48px;
    flex: 0 0 auto;
    justify-content: center;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  .nav a:not(.launch) { display: none; }
  .nav { justify-content: flex-end; }
  .logo { font-size: 15px; }
  .content { padding-top: 36px; padding-bottom: 56px; }
}
