/* Noir: white Courier on black, one narrow column. */

@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/courier-prime-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/courier-prime-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext: Polish letters (ł, ś, ż, ...) */
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/courier-prime-latin-ext-400.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/courier-prime-latin-ext-700.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --light: #000;               /* background */
  --dark: #fff;                /* foreground */
  --muted: #b0b0b0;
  --hairline: #ffffff33;
  --code-bg: #141414;
  --pre-bg: #0d1117;           /* matches github-dark-default */
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  --code-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --text-body: 17px;
  --text-small: 14px;
  --text-caption: 11px;
  --column: 38rem;             /* inner pages */
  --column-home: 320px;
  color-scheme: dark;          /* the site has one theme; highlighting follows it */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--light);
  color: var(--dark);
  font: var(--text-body)/1.65 var(--mono);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--dark); color: var(--light); }

/* Links: plain white, underlined, quiet on hover */
a { color: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 1px solid var(--dark); outline-offset: 3px; }
.link-quiet { text-decoration: none; }
.link-quiet:hover { text-decoration: underline; text-decoration-thickness: 1px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--dark); color: var(--light); padding: 0.25rem 0.5rem; z-index: 10; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Inverted label, like a highlighted menu entry */
.inv {
  display: inline-block;
  background: var(--dark);
  color: var(--light);
  font-weight: 700;
  padding: 0.1em 0.5em;
}

/* ---------- Home: centered splash ---------- */

.home {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}
.home-col { width: 100%; max-width: var(--column-home); }

.home-name {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.menu { list-style: none; margin: 2rem 0 0; padding: 0; }
.menu li { margin: 0.125rem 0; }
.menu a { display: inline-block; padding: 0.1em 0; }
.menu a .inv { margin-left: -0.5em; }
.menu a:hover .inv { text-decoration: none; }

.blurb { margin: 1.75rem 0 0; font-size: var(--text-small); }

.socials { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1rem; }
.socials a { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; transition: opacity 0.15s; }
.socials a:hover { opacity: 0.7; }
.socials svg { width: 18px; height: 18px; }

/* ---------- Inner pages ---------- */

header.site, main.page, footer.site {
  width: 100%;
  max-width: var(--column);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

header.site {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 0.5rem 1.25rem;
  padding-top: 1.5rem;
  margin-bottom: 3.5rem;
  font-size: var(--text-small);
}
.site-name { text-decoration: none; }
.site-name:hover { text-decoration: none; opacity: 0.85; }
header.site nav { display: flex; gap: 1.25rem; }
header.site nav a[aria-current] { text-decoration: underline; }

main.page { flex: 1; }

footer.site {
  margin-top: 5rem;
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: var(--text-small);
}
footer.site .socials { margin-top: 0; }

/* Typography */
h1, h2, h3, h4 { line-height: 1.25; margin: 2.5em 0 0.75em; font-weight: 700; }
h1 {
  margin-top: 0;
  font-size: 1.75rem;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.14em; }
h3 { font-size: 1rem; }
h4 { font-size: 1rem; font-weight: 400; text-decoration: underline; text-underline-offset: 4px; }
p, ul, ol, blockquote, table, pre, figure { margin: 0 0 1.25rem; }
ul, ol { padding-left: 1.5rem; }
li + li { margin-top: 0.25rem; }
strong { font-weight: 700; }
blockquote { margin-left: 0; padding-left: 1rem; border-left: 1px solid var(--dark); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 3rem 0; }
img, svg, video { max-width: 100%; height: auto; }
.meta { color: var(--muted); font-size: var(--text-small); margin-top: -0.25rem; font-variant-numeric: tabular-nums; }
.lede { color: var(--muted); font-size: var(--text-small); }

/* Code */
code, kbd, pre { font-family: var(--code-mono); font-size: 0.82em; }
:not(pre) > code, kbd {
  background: var(--code-bg);
  border: 1px solid var(--hairline);
  padding: 0.05em 0.3em;
}
pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  line-height: 1.5;
  border: 1px solid var(--hairline);
  background: var(--pre-bg);    /* highlighted blocks set their own inline */
  tab-size: 4;
}
pre code { font-size: inherit; }
pre.giallo { color-scheme: dark !important; }   /* giallo inlines "light dark" */
pre .giallo-ln { padding-right: 1em; user-select: none; }   /* ```lang,linenos */

/* Tables: scroll inside their own box on narrow screens */
table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: var(--text-small);
}
th, td { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: top; }
th { border-bottom-color: var(--dark); text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--text-caption); }

/* Figures: diagrams are drawn for a light page, so give them one */
figure { margin: 2rem 0; text-align: center; }
figure img { display: block; margin: 0 auto; background: #fff; }
figcaption { margin-top: 0.5rem; color: var(--muted); font-size: var(--text-small); }

/* Footnotes */
.footnotes { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--hairline); font-size: var(--text-small); }
.footnotes ol { padding-left: 1.25rem; }
sup { line-height: 0; }

/* Project + post lists */
.project-list, .post-list { list-style: none; padding: 0; }
.project-list li + li { margin-top: 1.25rem; }
.project-list a { font-weight: 700; }
.project-list p { margin: 0.15rem 0 0; color: var(--muted); font-size: var(--text-small); }
.post-list li { display: flex; align-items: baseline; gap: 1.25rem; }
.post-list time { flex: none; color: var(--muted); font-size: var(--text-small); font-variant-numeric: tabular-nums; }
