/* XLNF — notes.css
 * Shared stylesheet for the /notes/ layer.
 *
 * index.html deliberately inlines its CSS for a single-request first paint, so
 * the design tokens below are duplicated from it. That duplication is the price
 * of not regressing the landing page; notes are content pages where one extra
 * request is free, and keeping them in one file means N notes never drift from
 * each other. If the tokens change in index.html, change them here too.
 */

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bg: #0d1117;
  --fg: #c9d1d9;
  --muted: #8b949e;
  --accent: #7ee787;
  --accent-alt: #ff7b72;
  --border: #30363d;
}
/* "light" theme — intentionally barely lighter than dark. devs don't like light themes. */
:root[data-theme="light"] {
  --bg: #121820;
  --fg: #c9d1d9;
  --muted: #8b949e;
  --accent: #7ee787;
  --accent-alt: #ff7b72;
  --border: #363d47;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-mono); font-size: 15px; line-height: 1.55;
}
body { display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; outline: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--bg);
  padding: 8px 12px; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.container { max-width: 72ch; margin: 0 auto; padding: 24px 20px; width: 100%; }

header.site-header { border-bottom: 1px solid var(--border); padding: 20px 0 16px; }
header.site-header .prompt { color: var(--muted); margin: 0 0 12px; }
header.site-header .prompt .cursor {
  display: inline-block; width: 0.6ch;
  background: var(--accent); color: transparent;
  animation: blink 1s steps(2, end) infinite;
}
@media (prefers-reduced-motion: reduce) {
  header.site-header .prompt .cursor { animation: none; }
}
@keyframes blink { 50% { opacity: 0; } }
.header-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; color: var(--muted);
}
#theme-toggle {
  background: transparent; border: 1px solid var(--border);
  color: var(--fg); font-family: inherit; font-size: inherit;
  padding: 2px 8px; cursor: pointer;
}
#theme-toggle:hover { border-color: var(--accent); }

main { flex: 1; padding: 32px 0; }
h1, h2, h3 { color: var(--fg); font-weight: 700; }
h1 { font-size: 1.6rem; margin: 0 0 4px; line-height: 1.3; }
h2 { font-size: 1.15rem; margin: 32px 0 8px; color: var(--accent); }
h3 { font-size: 1rem; margin: 24px 0 6px; }
h2.section::before { content: "// "; color: var(--muted); }
.subtitle { color: var(--muted); margin: 0 0 20px; }
p { margin: 12px 0; }
ul, ol { padding-left: 1.4em; }
li { margin: 6px 0; }
hr { border: none; border-top: 1px dashed var(--border); margin: 28px 0; }

pre, code { font-family: var(--font-mono); }
code { font-size: 0.92em; }
:not(pre) > code {
  background: color-mix(in srgb, var(--fg) 9%, transparent);
  padding: 0.1em 0.35em; border-radius: 3px;
}
pre {
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  padding: 12px 14px; overflow-x: auto;
  border-left: 2px solid var(--accent);
  font-size: 0.88rem; line-height: 1.5;
}
pre code { background: none; padding: 0; }

.card { border: 1px solid var(--border); padding: 16px 18px; margin: 16px 0; }
.card h3 { margin-top: 0; color: var(--accent); }

blockquote {
  margin: 16px 0; padding: 2px 0 2px 14px;
  border-left: 2px solid var(--accent-alt); color: var(--muted);
}

/* --- breadcrumbs --- */
.breadcrumb { color: var(--muted); font-size: 0.85rem; margin: 0 0 18px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4em; }
.breadcrumb li::after { content: " /"; color: var(--border); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb [aria-current="page"] { color: var(--fg); }

/* --- note list (index) --- */
.note-list { list-style: none; padding: 0; margin: 8px 0 0; }
.note-list > li { border-top: 1px dashed var(--border); padding: 18px 0; margin: 0; }
.note-list > li:last-child { border-bottom: 1px dashed var(--border); }
.note-list h2 { margin: 0 0 6px; font-size: 1.05rem; color: var(--fg); }
.note-list h2 a { color: var(--accent); }
.note-meta { color: var(--muted); font-size: 0.82rem; margin: 0 0 8px; }
.note-list p { margin: 8px 0 0; }

/* --- tags --- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding: 0; list-style: none; }
.tags li {
  margin: 0; font-size: 0.75rem; color: var(--muted);
  border: 1px solid var(--border); padding: 1px 7px; border-radius: 3px;
}

/* --- article --- */
.note-header { margin-bottom: 26px; }
.note-header .note-meta { margin-top: 8px; }
.note-body > :first-child { margin-top: 0; }
.note-footer {
  margin-top: 36px; padding-top: 18px;
  border-top: 1px dashed var(--border); color: var(--muted); font-size: 0.9rem;
}

/* TL;DR / callout */
.tldr {
  border: 1px solid var(--border); border-left: 2px solid var(--accent);
  padding: 14px 16px; margin: 22px 0;
  background: color-mix(in srgb, var(--fg) 4%, transparent);
}
.tldr > :first-child { margin-top: 0; }
.tldr > :last-child { margin-bottom: 0; }
.tldr .tldr-label {
  display: block; color: var(--accent); font-size: 0.78rem;
  letter-spacing: 0.08em; margin-bottom: 6px;
}

footer.site-footer {
  border-top: 1px solid var(--border); color: var(--muted);
  padding: 16px 0 24px; font-size: 0.9rem;
}
footer.site-footer a { color: var(--muted); text-decoration: underline; }
footer.site-footer a:hover { color: var(--accent); }

#scroll-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 10;
  font-family: var(--font-mono); font-size: 0.85rem;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--accent); border: 1px solid var(--accent);
  border-radius: 4px; padding: 0.45rem 0.7rem; cursor: pointer;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
#scroll-top:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
#scroll-top[hidden] { display: none; }

/* tables, should a note need one */
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 0.9rem; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
th { color: var(--accent); font-weight: 700; }
