/* ============================================================
   Noir0x63 — Article standalone stylesheet
   Matches the site's monochrome brutalist design language.
   ============================================================ */

:root {
  --bg: #050505;
  --surface: rgba(255, 255, 255, 0.02);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #a3a3a3;
  --text-muted: #737373;
  --text-faint: #525252;
  --text-bright: #ffffff;
  --accent: #e0e0e0;
  --font-sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

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

html { color-scheme: dark; scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  padding: 3rem 1.5rem 4rem;
  max-width: 900px;
  margin: 0 auto;
}

::selection { background: rgba(255, 255, 255, 0.2); color: #000; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

/* ---------- Header / breadcrumb ---------- */
header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-faint);
  margin-bottom: 3rem;
}
header nav a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
header nav a:hover { color: var(--text-bright); }

/* ---------- Article metadata ---------- */
main > article > header { margin-bottom: 3rem; border-bottom: 1px solid var(--border); padding-bottom: 2rem; }

main > article > header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 300;
  color: var(--text-bright);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

main > article > header dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
}
main > article > header dl dt { color: var(--text-muted); }
main > article > header dl dd { color: var(--text-bright); font-weight: 500; }

/* ---------- Sections ---------- */
main > article > section {
  margin-top: 2.5rem;
}

main > article > section > h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-bright);
  border-left: 3px solid var(--border-strong);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

/* ---------- Prose ---------- */
p { margin: 0 0 1.25rem; color: var(--text); }
strong { color: var(--text-bright); font-weight: 600; }
em { color: var(--text-bright); font-style: italic; }
a { color: var(--text-bright); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
a:hover { text-decoration-color: var(--text-bright); }

h3 { color: var(--text-bright); font-size: 0.95rem; font-weight: 600; margin: 2.25rem 0 1rem; }
h4 { color: var(--text-bright); font-size: 0.85rem; font-weight: 600; margin: 1.75rem 0 0.75rem; }

ul, ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--text-faint); }

/* ---------- Code ---------- */
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15em 0.35em;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  white-space: pre;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-bright);
}
pre[class*="language-"] {
  background: #0a0a0c;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
  margin: 1.5rem 0;
  position: relative;
}
pre[class*="language-"] code[class*="language-"] {
  color: #e5e5e5;
  font-size: 0.8rem;
  line-height: 1.7;
}
.code-toolbar { position: relative; }
pre .token.comment,
pre .token.prolog,
pre .token.doctype { color: var(--text-faint); }
pre .token.punctuation { color: #8b949e; }
pre .token.keyword,
pre .token.operator { color: #ff7b72; }
pre .token.string,
pre .token.attr-value { color: #a5d6ff; }
pre .token.function,
pre .token.class-name { color: #d2a8ff; }
pre .token.number,
pre .token.boolean { color: #79c0ff; }
pre .token.property,
pre .token.attr-name,
pre .token.tag { color: #7ee787; }
pre .token.regex,
pre .token.important,
pre .token.variable { color: #ffa657; }
pre .token.selector { color: #7ee787; }

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
}
thead th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
}
th, td {
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}
th { color: var(--text-bright); font-weight: 600; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* ---------- Blockquote / callouts ---------- */
blockquote {
  border-left: 3px solid var(--border-strong);
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
}
blockquote p { color: var(--text-muted); margin-bottom: 0.5rem; }
blockquote p:last-child { margin-bottom: 0; }

/* ---------- Quick Answer / Key Takeaways ---------- */
main > article > section[aria-label="Quick Answer"] p {
  font-size: 1.05rem;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--text-bright);
  padding: 1.25rem 1.5rem;
  background: var(--surface);
}
main > article > section[aria-label="Key Takeaways"] li strong { color: var(--text-bright); }

/* ---------- Related articles ---------- */
section[aria-label="Related Articles"] {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
section[aria-label="Related Articles"] h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  border: none;
  padding: 0;
  margin-bottom: 1rem;
}
section[aria-label="Related Articles"] ul { list-style: none; padding-left: 0; }
section[aria-label="Related Articles"] li { margin-bottom: 0.5rem; }

/* ---------- Footer ---------- */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-faint);
}
footer hr { display: none; }
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--text-bright); }

/* ---------- Category index pages ---------- */
main > h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 300;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
main > p { color: var(--text-muted); margin-bottom: 2.5rem; }
main > section > h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--text-faint); margin-bottom: 1.5rem; }

main > section > article {
  border: 1px solid var(--border);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
main > section > article:hover { border-color: var(--border-strong); transform: translateY(-1px); }
main > section > article h2 { font-size: 1.05rem; font-weight: 300; margin-bottom: 0.5rem; }
main > section > article h2 a { color: var(--text-bright); text-decoration: none; }
main > section > article h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
main > section > article p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
main > section > article time { font-size: 0.75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body { padding: 2rem 1.25rem 3rem; font-size: 14px; }
  th, td { padding: 0.5rem 0.75rem; }
  main > article > header dl { flex-direction: column; gap: 0.25rem; }
}
