/*
  Observatory
  Bracketed section labels, tabular post rows, and a tabular article metadata
  header over a near-invisible 32px graticule grid with a small asterism in
  the masthead. Reads as an observation log: rigorous structure, sky around it.
*/

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-500.woff2') format('woff2');
}

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

:root {
  --bg:        #0e1014;
  --bg-soft:   #14171d;
  --bg-code:   #181b22;
  --ink:       #e2e0d6;
  --ink-bold:  #ecebe2;
  --ink-soft:  #8c8b84;
  --ink-mute:  #5a5953;
  --rule:      #232730;
  --rule-soft: #1a1d24;
  --grid:      #14171d;
  --link:      #98b8d4;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  /* Near-invisible 32px grid — reads as graph paper, planisphere
     graticule, or star-chart coordinate overlay. */
  background-image:
    linear-gradient(to right,  var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "onum";
  min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap {
  max-width: 660px; margin: 0 auto;
  padding: 4.5rem 1.5rem 5rem;
}

/* ── Masthead ───────────────────────────────────────────── */

header {
  display: flex; align-items: center; gap: 1.25rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--ink-mute);
}

.glyph {
  flex: 0 0 auto;
  width: 52px; height: 52px;
}
.glyph line   { stroke: var(--ink-mute); stroke-width: 0.5; }
.glyph circle { fill: var(--ink-bold); }
.glyph .warm  { fill: #ffd6aa; }
.glyph .cool  { fill: #bed7ff; }

h1.site-name {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 1.35rem; font-weight: 500;
  color: var(--ink-bold);
  letter-spacing: -0.005em; line-height: 1.1;
}

h1.site-name a { color: inherit; text-decoration: none; }

.subtitle {
  margin-top: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* ── Intro ──────────────────────────────────────────────── */

.intro { font-size: 1rem; line-height: 1.7; margin: 2rem 0 2.5rem; }
.intro p + p { margin-top: 0.9rem; }

/* ── Sections — bracketed labels ─────────────────────────── */

h2.section {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem; font-weight: 500;
  color: var(--ink-bold);
  margin-top: 2.8rem; margin-bottom: 1.15rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
  letter-spacing: 0.02em;
}
h2.section::before { content: '['; color: var(--ink-mute); margin-right: 0.4em; }
h2.section::after  { content: ']'; color: var(--ink-mute); margin-left: 0.4em; }

/* ── Post list — three-column tabular rows ───────────────── */

.posts { list-style: none; }
.posts li {
  padding: 0.5rem 0; font-size: 0.97rem;
  display: grid; grid-template-columns: 5.5rem 4.5rem 1fr;
  gap: 1rem; align-items: baseline;
  border-bottom: 1px solid var(--rule-soft);
}
.posts li:last-child { border-bottom: none; }
.posts .date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem; color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.posts .cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem; color: var(--ink-soft);
}
.posts .title a { color: var(--ink-bold); }
.posts .title a:hover {
  color: var(--link);
  text-decoration: underline; text-underline-offset: 3px;
}

.archive-link {
  margin-top: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}
.archive-link a { color: var(--ink-soft); }

/* Topics — slash-prefixed, reads as either tags or catalog paths */
.topics {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  display: flex; flex-wrap: wrap; gap: 0 1.25rem;
}
.topics a { color: var(--ink-bold); }
.topics a::before { content: '/ '; color: var(--ink-mute); }

/* Contact list */
.contact {
  list-style: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}
.contact li { padding: 0.25rem 0; display: flex; gap: 1rem; }
.contact .label {
  display: inline-block; width: 5rem;
  color: var(--ink-mute);
}

/* ── Article: metadata as a tabular header ──────────────── */

.article-meta-table {
  width: 100%;
  border-top: 1px solid var(--ink-mute);
  border-bottom: 1px solid var(--ink-mute);
  margin: 2rem 0 2rem;
  border-collapse: collapse;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
}
.article-meta-table th, .article-meta-table td {
  text-align: left; padding: 0.65rem 0.75rem;
  vertical-align: top;
}
.article-meta-table th {
  color: var(--ink-mute);
  font-weight: 400;
  width: 7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.article-meta-table td { color: var(--ink); }

h1.article-title {
  font-size: 1.7rem; font-weight: 500;
  line-height: 1.25; color: var(--ink-bold);
  letter-spacing: -0.01em;
}

/* Article body — borrowed leading from C for comfort */
.article-body { font-size: 1.06rem; line-height: 1.75; }
.article-body p { margin-top: 1.05rem; }
/* Italic Inter visually recedes — keep emphasis at full brightness */
.article-body em, .article-body i { color: var(--ink-bold); }
.article-body blockquote em, .article-body blockquote i { color: inherit; }
/* Underline links within prose — color alone is weak for scanning/contrast */
.article-body a { text-decoration: underline; text-underline-offset: 2px;
  text-decoration-color: var(--rule); }
.article-body a:hover { text-decoration-color: var(--link); }

/* Blockquotes — quiet left rule, set off and slightly recessed */
.article-body blockquote {
  margin: 1.4rem 0;
  padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 2px solid var(--ink-mute);
  color: var(--ink-soft);
  font-style: italic;
}
.article-body blockquote p { margin-top: 0; }
.article-body blockquote p + p { margin-top: 0.7rem; }

/* Horizontal rules need a little room to breathe, above and below */
.article-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 1.6rem 0;
}

/* Closing annex (em paragraph between two rules) reads as a quiet footnote */
.article-body hr + p em {
  color: var(--ink-soft);
}
.article-body h2 {
  font-size: 1.3rem; font-weight: 600;
  color: var(--ink-bold);
  letter-spacing: -0.01em;
  margin-top: 2.4rem; margin-bottom: 0.5rem;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em; background: var(--bg-code);
  color: var(--ink-bold);
  padding: 0.08em 0.32em; border-radius: 2px;
}

pre {
  background: var(--bg-code);
  border-left: 2px solid var(--rule);
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  overflow-x: auto;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.83rem; line-height: 1.55;
}
pre code { background: none; padding: 0; color: var(--ink); }

/* Sidenotes degrade to inline notes on this theme */
.sidenote {
  display: block;
  margin: 0.5rem 0 0.5rem 1.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--rule);
  font-size: 0.85rem; font-style: italic;
  line-height: 1.5; color: var(--ink-soft);
}
.sidenote-marker { color: var(--ink-soft); margin: 0 0.05em; }

footer {
  margin-top: 4rem; padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; color: var(--ink-mute);
  text-align: center;
  letter-spacing: 0.02em;
}
footer a { color: var(--ink-mute); }
footer a:hover { color: var(--ink-soft); }

:target { outline: none; }
