:root {
  --bg: #08080c;
  --text: #b0b0be;
  --heading: #f0f0f5;
  --muted: #55556a;
  --accent: #ff004f;
  --border: rgba(255, 255, 255, 0.06);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: "Source Serif 4", Georgia, serif;
  --display: "Instrument Serif", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Grain Overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Nav ── */

.article-nav {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.article-nav .sep {
  color: rgba(255, 255, 255, 0.1);
  margin: 0 0.5rem;
}

/* ── Article Header ── */

.article-header {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.25rem 0;
}

.article-header::after {
  content: "";
  display: block;
  margin-top: 1rem;
  border-bottom: 2px solid var(--accent);
}

.article-header h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  color: var(--heading);
  margin: 0;
}

.article-date {
  display: block;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-header .subtitle {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: #8a8a9a;
  margin: 0.8rem 0 0;
  line-height: 1.6;
}

/* ── Media (hero image or video) ── */

.article-media {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}

.article-media img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.article-media iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: none;
}

.article-media video {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ── Prose ── */

.prose {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.prose p {
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.8;
  margin: 0 0 1.4rem;
  color: #b0b0be;
}

.prose h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--heading);
  margin: 2.5rem 0 0.8rem;
}

.prose h3 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--heading);
  margin: 2rem 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.prose ul {
  margin: 0 0 1.4rem;
  padding-left: 1.2rem;
}

.prose li {
  font-size: 1.04rem;
  font-weight: 400;
  line-height: 1.75;
  margin-bottom: 0.3rem;
  color: #b0b0be;
}

.prose a {
  color: var(--heading);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: border-color 0.15s, color 0.15s;
}

.prose a:hover {
  color: #fff;
  border-bottom-color: var(--accent);
}

.prose figure {
  margin: 1.5rem 0;
}

.prose figure:first-child {
  margin-top: -0.5rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.prose figcaption {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.prose code {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.9em;
}

/* ── Article Footer ── */

.article-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.article-footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.article-footer a:hover {
  color: var(--accent);
}

/* ── Article Index Cards ── */

.cards {
  display: flex;
  flex-direction: column;
}

.card {
  display: block;
  padding: 0.8rem 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s;
}

.card:last-child {
  border-bottom: none;
}

.card:hover {
  border-color: var(--accent);
}

.card h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: #f0f0f5;
  margin: 0;
  transition: color 0.15s;
}

.card:hover h2 {
  color: var(--accent);
}

.card p {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #55556a;
  margin: 0.15rem 0 0;
}

/* ── Responsive ── */

@media (max-width: 700px) {
  .article-header {
    padding: 2rem 1rem 1.5rem;
  }

  .prose {
    padding: 1.5rem 1rem 2.5rem;
  }

  .prose p,
  .prose li {
    font-size: 1.02rem;
  }
}
