/* noisewhere: the stylesheet. Written by hand, one file, no framework.
   A dark room at 3 AM: the only light is the parking garage's sodium lamps coming through the
   blinds. Entries are set in a book face; everything the site itself says is in a monospace. */

@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/newsreader-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/newsreader-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/newsreader-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-style: italic; font-weight: 600; font-display: swap; src: url("/fonts/newsreader-latin-600-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #0e0f12;            /* the room */
  --bg-raised: #15171b;     /* paper in the dark */
  --ink: #d9d3c5;           /* writing: warm, never pure white */
  --ink-soft: #aaa496;
  --muted: #6f6a61;
  --rule: #23252a;
  --sodium: #e3913f;        /* the lamps outside */
  --sodium-soft: #c9864a;
  --sodium-dim: #7a4a22;
  --redact: #c2583f;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 640px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; position: relative;
  background: var(--bg) radial-gradient(120% 520px at 70% -120px, rgba(227, 145, 63, .13), rgba(227, 145, 63, 0) 70%) no-repeat;
  color: var(--ink);
  font: 400 19px/1.68 var(--serif);
  font-feature-settings: "kern", "liga", "onum";
}
/* Light through the blinds: faint orange slats across the top of the page, fading into the room. */
body::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 460px; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(180deg, rgba(227, 145, 63, .055) 0 12px, rgba(227, 145, 63, 0) 12px 26px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 100%);
  transform: skewY(-4deg); transform-origin: top right;
}
::selection { background: var(--sodium); color: var(--bg); }

a { color: var(--sodium-soft); text-decoration: underline; text-decoration-color: var(--sodium-dim); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:visited { color: #a37a55; }
a:hover { color: var(--sodium); text-decoration-color: var(--sodium); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--sodium); outline-offset: 3px; border-radius: 2px; }

.page { position: relative; z-index: 1; max-width: calc(var(--measure) + 48px); margin: 0 auto; padding: 0 max(24px, env(safe-area-inset-right, 0px)) 0 max(24px, env(safe-area-inset-left, 0px)); }

/* ---------- Header ---------- */
.site-head { padding: 72px 0 40px; border-bottom: 1px solid var(--rule); margin-bottom: 48px; }
.brand, .brand:visited { font: 500 26px/1 var(--mono); letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.tagline { margin: 14px 0 0; font: italic 400 18px/1.4 var(--serif); color: var(--ink-soft); }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 26px; font: 400 13px/1 var(--mono); }
.site-nav a, .site-nav a:visited { color: var(--muted); text-decoration: none; }
.site-nav a::before { content: "./"; color: #3d3f45; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--sodium); }
.site-nav a[aria-current="page"]::before { color: var(--sodium-dim); }

/* ---------- Entries ---------- */
.entry { margin: 0 0 64px; min-width: 0; }
.entry + .entry { padding-top: 56px; border-top: 1px solid var(--rule); }
.entry-meta { display: flex; gap: 14px; align-items: baseline; margin-bottom: 10px; font: 400 12.5px/1 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-no { color: var(--sodium-dim); }
.entry-meta .at { color: var(--sodium-soft); }
.entry-title { margin: 0 0 22px; font: 600 30px/1.2 var(--serif); letter-spacing: -.01em; }
.entry-title a, .entry-title a:visited { color: var(--ink); text-decoration: none; }
.entry-title a:hover { color: var(--sodium); }

.post-body p { margin: 0 0 1.05em; }
.post-body ol, .post-body ul { margin: 0 0 1.05em; padding-left: 1.3em; }
.post-body li { margin-bottom: .35em; }
.post-body li::marker { color: var(--sodium-dim); }
.post-body b, .post-body strong { font-weight: 600; color: #ece6d8; }
.post-body .edit { color: var(--muted); font-style: italic; font-size: .9em; }
.post-body > :last-child { margin-bottom: 0; }
blockquote { margin: 0 0 1.05em; padding: 2px 0 2px 18px; border-left: 2px solid var(--sodium-dim); color: var(--ink-soft); font-style: italic; }

/* "still here": a different hand. Slightly different face, colour, spacing and measure.
   Most readers won't notice. The ones comparing entries will. */
.post--still-here .post-body { font-family: "Times New Roman", Times, serif; font-size: 19.5px; color: #e9e6df; line-height: 1.95; word-spacing: .05em; max-width: 34em; font-feature-settings: normal; }
.post--still-here .entry-title { font-family: "Times New Roman", Times, serif; font-weight: 400; }

/* ---------- Pages (archive, about, 404, drafts) ---------- */
.card { margin-bottom: 56px; min-width: 0; }
.page-title { margin: 0 0 24px; font: 600 30px/1.2 var(--serif); letter-spacing: -.01em; color: var(--ink); }
.page-title .count { font: 400 15px var(--mono); color: var(--muted); }
.date-header { margin: 0 0 10px; font: 400 12.5px/1 var(--mono); color: var(--muted); }
.ghost { color: var(--bg); }
.back { font: 400 13px var(--mono); }
.status-msg { margin: 0 0 40px; padding: 12px 16px; background: var(--bg-raised); border: 1px solid var(--rule); font: 400 13px/1.6 var(--mono); color: var(--ink-soft); }
.status-msg b { color: var(--ink); font-weight: 500; }
.preview-note { margin: 0 0 14px; padding: 8px 12px; border: 1px dashed var(--sodium-dim); font: 400 12.5px/1.5 var(--mono); color: var(--sodium-soft); }

.search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 36px; font: 400 13px var(--mono); }
.search label { color: var(--muted); }
.search label::after { content: " >"; color: var(--sodium-dim); }
.search input, .unlock input { flex: 1 1 14rem; min-width: 0; padding: 8px 10px; background: var(--bg-raised); border: 1px solid var(--rule); border-radius: 2px; color: var(--ink); font: 400 15px var(--mono); }
.search input:focus, .unlock input:focus { border-color: var(--sodium-dim); outline: none; }
.search button, .unlock button { padding: 8px 16px; background: transparent; border: 1px solid var(--sodium-dim); border-radius: 2px; color: var(--sodium-soft); font: 400 13px var(--mono); cursor: pointer; }
.search button:hover, .unlock button:hover { border-color: var(--sodium); color: var(--sodium); }

.archive-list h3 { margin: 32px 0 10px; font: 500 13px var(--mono); color: var(--sodium-dim); }
.archive-list h3:first-child { margin-top: 0; }
.archive-list ul { list-style: none; margin: 0; padding: 0; }
.archive-list li { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.archive-list time { font: 400 12.5px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.archive-list a, .archive-list a:visited { color: var(--ink); text-decoration: none; }
.archive-list a:hover { color: var(--sodium); }

/* ---------- Pager ---------- */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; padding: 24px 0 0; margin-bottom: 64px; border-top: 1px solid var(--rule); font: 400 13px var(--mono); }
.pager a, .pager a:visited { color: var(--ink-soft); text-decoration: none; }
.pager a:hover { color: var(--sodium); }
.pager .home { color: var(--muted); }
.pager .older { text-align: right; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--rule); padding: 28px 0 40px; font: 400 12.5px/1.6 var(--mono); color: var(--muted); }
.now { display: grid; gap: 6px; margin: 0 0 24px; }
.now div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 12px; }
.now dt { color: var(--muted); }
.now dt::after { content: ":"; }
.now dd { margin: 0; color: var(--ink-soft); }
.now [data-counter] { font-variant-numeric: tabular-nums; color: var(--sodium-soft); }
.foot-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; }

/* ---------- Drafts (the blog's own private area) ---------- */
.draftbar { position: relative; z-index: 2; padding: 8px max(24px, env(safe-area-inset-left, 0px)); background: #1a1410; border-bottom: 1px solid var(--sodium-dim); font: 400 12.5px var(--mono); color: var(--sodium-soft); text-align: center; }
.draft-list { list-style: none; margin: 0 0 32px; padding: 0; border-top: 1px solid var(--rule); }
.draft-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.draft-list .t { font-weight: 600; }
.draft-list .t a, .draft-list .t a:visited { color: var(--ink); text-decoration: none; }
.draft-list .t a:hover { color: var(--sodium); }
.draft-list .d { font: 400 12.5px var(--mono); color: var(--muted); }
.draft-list .sched .t { font-weight: 400; font-style: italic; color: var(--muted); }
.unlock { display: grid; gap: 10px; }
.unlock label { font: 400 13px/1.5 var(--mono); color: var(--ink-soft); }
.unlock .row { display: flex; flex-wrap: wrap; gap: 10px; }
.unlock .msg { margin: 0; min-height: 1.4em; font: 400 13px var(--mono); color: var(--redact); }
.closed { margin: 0; font: italic 400 16px var(--serif); color: var(--muted); }
.found-page { display: grid; gap: 4px; margin: 0 0 1.05em; padding: 16px 18px; overflow-x: auto; background: var(--bg-raised); border: 1px solid var(--rule); border-left: 2px solid var(--sodium-dim); font: 400 15px/1.6 var(--mono); }
.found-page .head { font: 400 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.found-page .cipher { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--rule); color: var(--redact); letter-spacing: .12em; word-spacing: .3em; }

@media (max-width: 640px) {
  body { font-size: 17.5px; }
  .site-head { padding: 44px 0 28px; margin-bottom: 36px; }
  .brand { font-size: 22px; }
  .entry-title, .page-title { font-size: 25px; }
  .entry { margin-bottom: 48px; }
  .entry + .entry { padding-top: 40px; }
  .post--still-here .post-body { font-size: 18px; }
  .archive-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .now div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .now div + div { margin-top: 6px; }
}
