/* ── Article / Essay / Paper stylesheet ──────────────
   Matches the main site's European minimalist theme.
   Loaded by standalone HTML pages in /essays/ and /papers/.
   ─────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500&display=swap');

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: #F6F5F1;
  color: #1a1a1a;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-optical-sizing: auto;
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
}

::selection {
  background: #1a1a1a;
  color: #F6F5F1;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

@media (max-width: 768px) {
  .container {
    padding: 2rem 1.5rem 3rem;
  }
}

/* ── Header / Nav ─────────────────────────────────── */

header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}

header h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: rgba(26, 26, 26, 0.35);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: #1a1a1a;
}

/* ── Article content ──────────────────────────────── */

article {
  margin-top: 2rem;
}

article h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: #1a1a1a;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

article h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: #1a1a1a;
  border-left: 2px solid rgba(26, 26, 26, 0.12);
  padding-left: 1rem;
  letter-spacing: -0.01em;
}

article h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

article h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: rgba(26, 26, 26, 0.8);
}

article p {
  margin-bottom: 1.25rem;
  color: rgba(26, 26, 26, 0.6);
  line-height: 1.8;
  font-size: 1.02rem;
}

article strong {
  color: #1a1a1a;
  font-weight: 500;
}

article em {
  color: rgba(26, 26, 26, 0.55);
  font-style: italic;
}

article a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: rgba(26, 26, 26, 0.25);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.2s ease;
}

article a:hover {
  text-decoration-color: #1a1a1a;
}

/* ── Meta ─────────────────────────────────────────── */

.post-meta {
  font-size: 0.9rem;
  color: rgba(26, 26, 26, 0.35);
  margin-bottom: 2.5rem;
  font-style: italic;
}

.paper-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}

.paper-header h1 {
  font-size: 2rem;
  line-height: 1.25;
}

.paper-meta {
  font-size: 0.9rem;
  color: rgba(26, 26, 26, 0.4);
  margin: 1rem 0;
  line-height: 1.6;
}

.download-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.25rem;
  background-color: #1a1a1a;
  color: #F6F5F1;
  border: 1px solid #1a1a1a;
  border-radius: 0;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.download-btn:hover {
  background-color: transparent;
  color: #1a1a1a;
}

/* ── Code ─────────────────────────────────────────── */

pre {
  background-color: #EEEEE9;
  border: 1px solid rgba(26, 26, 26, 0.06);
  border-radius: 0;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

code {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  font-size: 0.88rem;
  color: rgba(26, 26, 26, 0.7);
  line-height: 1.5;
}

pre code {
  color: rgba(26, 26, 26, 0.65);
  font-size: 0.85rem;
}

/* ── Blockquotes ──────────────────────────────────── */

blockquote {
  border-left: 2px solid rgba(26, 26, 26, 0.12);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  color: rgba(26, 26, 26, 0.5);
  font-style: italic;
}

blockquote p {
  color: rgba(26, 26, 26, 0.5);
}

/* ── Lists ────────────────────────────────────────── */

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

li {
  margin-bottom: 0.5rem;
  color: rgba(26, 26, 26, 0.6);
  line-height: 1.75;
}

li strong {
  color: #1a1a1a;
}

/* ── Tables ───────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(26, 26, 26, 0.08);
}

th {
  background-color: rgba(26, 26, 26, 0.03);
  font-weight: 500;
  color: #1a1a1a;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

td {
  color: rgba(26, 26, 26, 0.6);
}

/* ── Misc ─────────────────────────────────────────── */

hr {
  border: none;
  border-top: 1px solid rgba(26, 26, 26, 0.08);
  margin: 2.5rem 0;
}

a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  opacity: 0.5;
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 768px) {
  article h1 {
    font-size: 1.75rem;
  }

  article h2 {
    font-size: 1.3rem;
  }

  article h3 {
    font-size: 1rem;
  }

  header h1 {
    font-size: 1.2rem;
  }
}

/* ── Print ────────────────────────────────────────── */

@media print {
  body {
    background-color: white;
    color: #000;
  }

  article h1, article h2, article h3, strong {
    color: #000;
  }

  article p, li {
    color: #333;
  }

  pre {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
  }
}
