/* nevinv.com — "lowres" theme
   One centered paper column on a dithered desk. The desk is a canvas (site.js)
   that reacts to the star cursor. */

:root {
  --desk: #b9b8cf;
  --desk-2: #aeadc6;
  --paper: #ecebf3;
  --paper-2: #e1e0ea;
  --ink: #22223a;
  --mute: #6b6a88;
  --rule: #8d8cab;
  --rule-soft: #c3c2d6;
  --blue: #3b3bd0;
  --link: #2b2bd9;
  --visited: #7a2bb0;
  --pixel: "Silkscreen", "Courier New", monospace;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--desk); }
html { cursor: var(--cursor, auto); }
a, button, [role="button"] { cursor: var(--cursor-link, pointer); }
body { color: var(--ink); font-family: var(--mono); font-size: 14px; line-height: 1.65; }
::selection { background: var(--blue); color: #fff; }

#field {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
  background-color: var(--desk);
  background-image: conic-gradient(var(--desk-2) 25%, transparent 0 50%, var(--desk-2) 0 75%, transparent 0);
  background-size: 4px 4px;
}

.page {
  position: relative; z-index: 1;
  padding-block: 56px 72px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.paper { max-width: 620px; margin: 0 auto; background: var(--paper); border: 1px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--blue); color: #fff; padding: 4px 8px; font-family: var(--pixel); font-size: 11px; }
.bar .dots { letter-spacing: 4px; opacity: .9; }

.inner { padding: 28px 32px 8px; display: grid; gap: 30px; }
@media (max-width: 520px) { .inner { padding: 22px 18px 4px; gap: 26px; } }

/* header */
header.site { display: grid; gap: 10px; }
.name { font-family: var(--pixel); font-size: 26px; line-height: 1; margin: 0; font-weight: 400; }
.name a, .name a:visited { color: inherit; text-decoration: none; }
.name a:hover { background: none; color: inherit; }
.caret { display: inline-block; width: 12px; height: 22px; background: var(--ink); vertical-align: -2px; margin-left: 4px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tagline { margin: 0; color: var(--mute); }
nav.main { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--pixel); font-size: 12px; }
nav.main a, nav.main a:visited { color: var(--link); text-decoration: none; }
nav.main a:hover { background: none; color: var(--link); text-decoration: underline; }
nav.main a.on { color: var(--ink); background: var(--desk); padding: 0 4px; margin: 0 -4px; text-decoration: none; }

/* text */
a { color: var(--link); text-underline-offset: 2px; }
a:visited { color: var(--visited); }
a:hover { background: var(--blue); color: #fff; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px dotted var(--ink); outline-offset: 2px; }
hr { border: 0; border-top: 1px dashed var(--rule); margin: 0; }
h2 { font-family: var(--pixel); font-weight: 400; font-size: 13px; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
h2 small { font-family: var(--mono); font-size: 11px; color: var(--mute); }
h2 small a, h2 small a:visited { color: var(--mute); }
section p { margin: 0; }
section p + p { margin-top: 10px; }
.mute { color: var(--mute); }
.empty { color: var(--mute); font-style: italic; }

/* posts list */
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.posts li { display: grid; grid-template-columns: 92px 1fr; gap: 2px 14px; }
.posts time { color: var(--mute); font-variant-numeric: tabular-nums; }
.posts .t { font-weight: 500; }
.posts .d { grid-column: 2; color: var(--mute); font-size: 13px; }
@media (max-width: 520px) { .posts li { grid-template-columns: 1fr; } .posts .d { grid-column: 1; } }

/* projects list */
.projects { list-style: none; margin: 0; padding: 0; }
.projects li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 6px 0; border-bottom: 1px dotted var(--rule-soft); }
.projects li:last-child { border-bottom: 0; }
.projects .meta { color: var(--mute); font-size: 12px; white-space: nowrap; }
.projects .desc { color: var(--mute); }
.projects.full .desc { grid-column: 1 / -1; font-size: 13px; }

/* labeled boxes: now.txt, rating.dat */
.box { border: 1px solid var(--ink); background: #fff; padding: 12px 14px 10px; position: relative; }
.box::before { content: attr(data-label); position: absolute; top: -9px; left: 10px; background: var(--paper); padding: 0 6px; font-family: var(--pixel); font-size: 10px; line-height: 16px; }
.box ul { margin: 0; padding-left: 1.2em; list-style: square; }
.boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; }
@media (max-width: 560px) { .boxes { grid-template-columns: 1fr; } }

/* codeforces widget */
.cf { display: grid; gap: 8px; }
.cf-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cf-rating { font-family: var(--pixel); font-size: 22px; line-height: 1; }
.cf-rank { font-size: 12px; }
.cf-delta { font-size: 12px; margin-left: auto; font-variant-numeric: tabular-nums; }
.cf-graph { width: 100%; height: 56px; image-rendering: pixelated; image-rendering: crisp-edges; display: block; border: 1px solid var(--rule-soft); }
.cf-next { display: grid; gap: 3px; font-size: 11px; color: var(--mute); }
.cf-bar { height: 8px; border: 1px solid var(--ink); background: var(--paper); position: relative; }
.cf-bar i { position: absolute; inset: 0 auto 0 0; background: var(--blue); }

/* status bar */
.status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; border-top: 1px solid var(--ink); background: var(--paper-2); padding: 4px 10px; margin-top: 22px; font-size: 11px; color: var(--mute); }
.status .links { display: flex; gap: 12px; }

/* single post */
article.post { display: grid; gap: 14px; }
article.post h1 { font-family: var(--pixel); font-weight: 400; font-size: 20px; line-height: 1.2; margin: 0; text-wrap: balance; }
article.post .byline { color: var(--mute); font-size: 12px; }
article.post h2 { margin: 12px 0 0; }
article.post p, article.post ul, article.post ol { margin: 0; max-width: 64ch; }
article.post pre { margin: 0; background: #fff; border: 1px solid var(--ink); padding: 10px 12px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
article.post code { font-family: var(--mono); font-size: .95em; }
article.post :not(pre) > code { background: var(--paper-2); padding: 0 4px; }
article.post img { max-width: 100%; border: 1px solid var(--ink); image-rendering: pixelated; }
article.post blockquote { margin: 0; padding-left: 12px; border-left: 3px solid var(--rule); color: var(--mute); }

article.post hr { margin: 6px 0; }
article.post div.highlight, article.post figure.highlight { margin: 0; }
.post-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; border-top: 1px dashed var(--rule); padding-top: 12px; }

/* syntax highlighting (rouge), in the site palette */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp, .highlight .cpf { color: #8a89a3; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kc { color: var(--blue); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sh, .highlight .se, .highlight .sx { color: #a1306b; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .il { color: #a1306b; }
.highlight .nf, .highlight .fm, .highlight .nc { color: var(--ink); font-weight: 500; }
.highlight .nb, .highlight .bp { color: var(--visited); }
.highlight .o, .highlight .ow, .highlight .p { color: var(--mute); }
.highlight .err { color: inherit; background: none; }

@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }
