/* Signal — Swiss Typographic Theme
   Principles: clarity, rhythm, whitespace, restraint
   Dark mode. Monospace titles. Signal aesthetic. */

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

/* ---- Root / Custom Properties ---- */
:root {
  --text: #c8c8c8;
  --text-secondary: #707070;
  --bg: #0d0d0d;
  --surface: #141414;
  --border: #252525;
  --accent: #e0e0e0;
  --code-bg: #181818;
  --font-body: "Inter", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Consolas", monospace;
  --measure: 65ch;
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 3rem;
  --space-xl: 5rem;
}

/* ---- Base ---- */
html {
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  padding: var(--space-l) var(--space-m);
}

/* ---- Layout ---- */
.site {
  max-width: 820px;
  margin: 0 auto;
}

.content {
  max-width: var(--measure);
}

/* ---- Typography — headings in mono ---- */
h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--accent);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: var(--space-m);
}

h2 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin-top: var(--space-l);
  margin-bottom: var(--space-s);
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-top: var(--space-m);
  margin-bottom: var(--space-xs);
}

p {
  margin-bottom: var(--space-s);
}

/* ---- Links ---- */
a {
  color: var(--accent);
  text-decoration-color: var(--text-secondary);
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

/* ---- Header ---- */
.site-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-m);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.site-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: var(--space-m);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  text-transform: lowercase;
}

.site-nav a:hover {
  color: var(--accent);
}

/* ---- Post List (Home) ---- */
.post-list {
  list-style: none;
}

.post-item {
  padding: var(--space-m) 0;
  border-bottom: 1px solid var(--border);
}

.post-item:first-child {
  padding-top: 0;
}

.post-item-title {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.post-item-title a {
  text-decoration: none;
  color: var(--accent);
}

.post-item-title a:hover {
  color: #fff;
}

.post-item-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

.post-item-summary {
  margin-top: 0.6rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ---- Single Post ---- */
.post-header {
  margin-bottom: var(--space-l);
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  margin-top: var(--space-xs);
}

.post-tags {
  margin-top: var(--space-xs);
}

.post-tags a {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.post-tags a:hover {
  color: var(--accent);
}

.post-tags a::before {
  content: "#";
}

.post-body {
  max-width: var(--measure);
}

.post-body > * + * {
  margin-top: var(--space-s);
}

.post-body h2,
.post-body h3 {
  margin-top: var(--space-l);
}

/* ---- Lists in content ---- */
.post-body ul,
.post-body ol {
  padding-left: 1.25em;
  margin-bottom: var(--space-s);
}

.post-body li {
  margin-bottom: 0.35em;
}

.post-body li::marker {
  color: var(--text-secondary);
}

/* ---- Blockquote ---- */
blockquote {
  border-left: 2px solid var(--border);
  padding-left: var(--space-s);
  color: var(--text-secondary);
  font-style: italic;
  margin: var(--space-m) 0;
}

/* ---- Code ---- */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  color: var(--accent);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  padding: var(--space-s) var(--space-m);
  border-radius: 4px;
  overflow-x: auto;
  margin: var(--space-m) 0;
  font-size: 0.8125rem;
  line-height: 1.55;
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  border: none;
  color: var(--text);
}

/* ---- Images ---- */
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--space-m) 0;
  border-radius: 4px;
}

figure {
  margin: var(--space-m) 0;
}

figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-m) 0;
  font-size: 0.9375rem;
}

th, td {
  text-align: left;
  padding: 0.5em 0.75em;
  border-bottom: 1px solid var(--border);
}

th {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

/* ---- Horizontal rule ---- */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-l) 0;
}

/* ---- Footer ---- */
.site-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-m);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

/* ---- Tags Page ---- */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
}

.tag-list a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.3em 0.75em;
  border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}

.tag-list a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- Selection ---- */
::selection {
  background: #333;
  color: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  body {
    padding: var(--space-m) var(--space-s);
    font-size: 1.0625rem;
  }

  .site-header {
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-l);
  }
}
