/* loganlenz.com v2: the plain ("lo-fi") pages.
   Paper, ink, one accent, one narrow column. The room (index.html with WebGL)
   has its own stylesheet, room.css, and uses the same tokens. */

:root {
  --paper: #f3efe6;
  --sheet: #faf8f2;
  --ink: #1b1814;
  --soft: #4b453d;
  --muted: #7d766b;
  --rule: rgba(27, 24, 20, 0.14);
  --rule-strong: rgba(27, 24, 20, 0.28);
  --accent: #1c7038;
  --accent-ink: #ffffff;
  --warn: #8f5200;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --col: 640px;
  --wide: 1080px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121316;
    --sheet: #1a1b1f;
    --ink: #ebe6da;
    --soft: #b9b2a5;
    --muted: #807a70;
    --rule: rgba(235, 230, 218, 0.14);
    --rule-strong: rgba(235, 230, 218, 0.3);
    --accent: #6fe08c;
    --accent-ink: #0f1a12;
    --warn: #ffb867;
  }
}
:root[data-theme="dark"] {
  --paper: #121316;
  --sheet: #1a1b1f;
  --ink: #ebe6da;
  --soft: #b9b2a5;
  --muted: #807a70;
  --rule: rgba(235, 230, 218, 0.14);
  --rule-strong: rgba(235, 230, 218, 0.3);
  --accent: #6fe08c;
  --accent-ink: #0f1a12;
  --warn: #ffb867;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

/* ---------- header ---------- */
.site-head {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 18px var(--gutter) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-head .name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
.site-head nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-head nav a, .site-head nav button {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--soft);
  padding: 6px 9px;
  border-radius: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}
.site-head nav a:hover, .site-head nav button:hover { color: var(--ink); background: var(--rule); }
.site-head nav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.site-head nav .room-link { border: 1px solid var(--rule-strong); margin-left: 6px; }
.site-head nav .room-link::before { content: "\25B6\FE0E"; margin-right: 0.6em; font-size: 0.8em; }
.site-head nav .room-link[hidden] { display: none; }

/* ---------- page ---------- */
main.page { max-width: var(--col); margin: 0 auto; padding: 0 var(--gutter) 48px; }
main.page.wide { max-width: var(--wide); }

.lead { padding: clamp(36px, 7vw, 72px) 0 8px; }
.lead h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 14px;
}
.lead .dek {
  font-family: var(--serif);
  font-size: clamp(19px, 2.2vw, 23px);
  line-height: 1.45;
  margin: 0;
  color: var(--ink);
  max-width: 34em;
}
.lead .more { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; }

hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 28px 0; }

/* the still of the room, linking into it */
.still { margin: 8px 0 0; }
.still a { display: block; line-height: 0; border-radius: 4px; overflow: hidden; background: #07080d; }
.still img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.still figcaption { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 8px; letter-spacing: 0.02em; }

/* the "you're on the plain version" box */
.notice {
  position: relative;
  margin: 16px 0 0;
  padding: 14px 44px 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--sheet);
  background-image: repeating-linear-gradient(135deg, var(--warn) 0 9px, transparent 9px 18px);
  background-size: 100% 4px;
  background-repeat: no-repeat;
}
.notice[hidden] { display: none; }
.notice .k { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--warn); margin: 4px 0 6px; }
.notice p { margin: 0; font-size: 14.5px; color: var(--soft); }
.notice .btn { margin-top: 12px; }
.notice .x { position: absolute; top: 10px; right: 8px; width: 30px; height: 30px; border: 0; background: none; color: var(--muted); font-family: var(--mono); font-size: 18px; cursor: pointer; border-radius: 2px; }
.notice .x:hover { color: var(--ink); background: var(--rule); }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--accent-ink);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 8px 12px 7px;
  cursor: pointer;
}
:root[data-theme="dark"] .btn, .btn { color: var(--paper); }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.play::before { content: "\25B6\FE0E"; margin-right: 0.7em; font-size: 0.8em; }

/* ---------- sections and rows ---------- */
section.block { padding: 36px 0 8px; }
section.block > h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.k-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 26px 0 4px; }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rows > li { border-bottom: 1px solid var(--rule); padding: 14px 0 15px; }
.rows .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.rows .t { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.25; margin: 0; text-decoration: none; }
a.t:hover { color: var(--accent); }
.rows .y { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; flex: none; }
.rows p { margin: 5px 0 0; font-size: 14.5px; color: var(--soft); max-width: 44em; }
.rows p a { color: var(--ink); }
.rows p a:hover { color: var(--accent); }
.rows.compact > li { padding: 10px 0 11px; }
.rows.compact .t { font-size: 17px; }

/* posts, grouped by year */
.log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.log > li { border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 5ch minmax(0, 1fr); gap: 0 16px; padding: 12px 0; }
.log .yr { font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 5px; }
.log ol { list-style: none; margin: 0; padding: 0; }
.log ol a { display: grid; grid-template-columns: minmax(0, 1fr) 8ch; gap: 0 12px; align-items: baseline; padding: 5px 0; text-decoration: none; }
.log ol a .r { font-family: var(--serif); font-size: 17.5px; line-height: 1.3; }
.log ol a .d { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.log ol a:hover .r { color: var(--accent); }
.log .older { grid-column: 2; }
.log .older button { font-family: var(--mono); font-size: 12.5px; background: none; border: 0; padding: 6px 0; color: var(--soft); cursor: pointer; text-decoration: underline; text-underline-offset: 0.15em; }
.log .older button:hover { color: var(--accent); }
.log .empty { grid-column: 1 / -1; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
@media (max-width: 520px) {
  .log > li { grid-template-columns: 1fr; }
  .log .older { grid-column: 1; }
}

/* figures (By the Numbers) */
.figs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.figs > li { border-bottom: 1px solid var(--rule); padding: 14px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 20px; align-items: baseline; }
.figs .v { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.1; letter-spacing: -0.01em; }
.figs .l { grid-column: 1; font-size: 14.5px; color: var(--soft); }
.figs .s { grid-column: 1 / -1; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.figs .c { grid-column: 2; grid-row: 1; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* chips (blog filter) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 20px; }
.chips button { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); background: none; border: 1px solid var(--rule); border-radius: 2px; padding: 6px 9px 5px; cursor: pointer; }
.chips button:hover { color: var(--ink); border-color: var(--rule-strong); }
.chips button[aria-pressed="true"] { color: var(--accent-ink); background: var(--ink); border-color: var(--ink); }
:root[data-theme="dark"] .chips button[aria-pressed="true"], .chips button[aria-pressed="true"] { color: var(--paper); }
.search { width: 100%; font-family: var(--mono); font-size: 13px; padding: 9px 11px; border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--sheet); color: var(--ink); }
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* newsletter form */
.signup { margin: 8px 0 0; padding: 18px 20px; border: 1px solid var(--rule); border-radius: 4px; background: var(--sheet); }
.signup h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 4px; }
.signup p { margin: 0 0 12px; font-size: 14.5px; color: var(--soft); }
.signup form { display: flex; gap: 8px; flex-wrap: wrap; }
.signup input { flex: 1 1 220px; font-family: var(--mono); font-size: 13px; padding: 9px 11px; border: 1px solid var(--rule-strong); border-radius: 2px; background: var(--paper); color: var(--ink); }
.signup input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.signup .msg { margin: 10px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.signup .msg.err { color: #b3402c; }
.signup .msg:empty { display: none; }

/* ---------- article (blog post, about) ---------- */
.phead { padding: clamp(32px, 6vw, 56px) 0 16px; }
.phead .cats { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.phead h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 5vw, 44px); line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 12px; }
.phead .dek { font-family: var(--serif); font-size: 19px; line-height: 1.45; color: var(--soft); margin: 0 0 14px; }
.phead .meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.prose { font-size: 17px; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-family: var(--serif); font-weight: 700; font-size: 26px; line-height: 1.2; margin-top: 1.8em; letter-spacing: -0.01em; }
.prose h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; margin-top: 1.5em; }
.prose p { margin: 0; }
.prose p + p { margin-top: 1.1em; }
.prose a { color: var(--ink); text-decoration-color: var(--rule-strong); }
.prose a:hover { color: var(--accent); }
.prose blockquote { margin: 1.4em 0; padding: 0 0 0 18px; border-left: 2px solid var(--accent); color: var(--soft); font-family: var(--serif); font-size: 19px; }
.prose img { border-radius: 4px; margin: 1.4em auto; }
.prose figure { margin: 1.4em 0; }
.prose figcaption { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 8px; }
.prose pre { background: var(--sheet); border: 1px solid var(--rule); border-radius: 4px; padding: 14px 16px; overflow: auto; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
.prose code { font-family: var(--mono); font-size: 0.92em; background: var(--sheet); padding: 0.1em 0.35em; border-radius: 3px; }
.prose pre code { background: none; padding: 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.prose iframe, .prose video { max-width: 100%; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose td, .prose th { border: 1px solid var(--rule); padding: 6px 10px; text-align: left; }

/* about page's story chapters: text with a photo beside it */
.chapter { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 28px; align-items: start; padding: 28px 0; border-top: 1px solid var(--rule); }
.chapter:first-of-type { border-top: 0; }
.chapter h2 { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.01em; }
.chapter p { margin: 0 0 1em; font-size: 16.5px; line-height: 1.65; }
.chapter p:last-child { margin-bottom: 0; }
.chapter img { border-radius: 4px; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.chapter figure { margin: 4px 0 0; }
.chapter figcaption { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 6px; }
@media (max-width: 620px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter img { aspect-ratio: 4 / 3; }
}

.nextprev { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--rule); }
.nextprev a { text-decoration: none; }
.nextprev .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 4px; }
.nextprev .r { font-family: var(--serif); font-size: 17px; line-height: 1.3; }
.nextprev a:hover .r { color: var(--accent); }
.nextprev .next { text-align: right; }
.nextprev a:empty { visibility: hidden; }

.share { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 28px; }
.share a, .share button { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--soft); border: 1px solid var(--rule); border-radius: 2px; padding: 7px 10px 6px; background: none; cursor: pointer; }
.share a:hover, .share button:hover { color: var(--ink); border-color: var(--rule-strong); }

/* ---------- footer ---------- */
.site-foot { max-width: var(--wide); margin: 40px auto 0; padding: 18px var(--gutter) 40px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-foot nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-foot a { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em; text-decoration: none; color: var(--soft); }
.site-foot a:hover { color: var(--accent); }
.site-foot .c { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.loading { font-family: var(--mono); font-size: 12.5px; color: var(--muted); padding: 12px 0; }

/* the contact form on the plain home */
form.contact { display: grid; gap: 12px; margin-top: 14px; max-width: 520px; }
form.contact label { display: grid; gap: 5px; }
form.contact label span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
form.contact input, form.contact textarea { font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--sheet); color: var(--ink); width: 100%; }
form.contact textarea { resize: vertical; min-height: 140px; font-family: var(--serif); line-height: 1.45; }
form.contact input:focus, form.contact textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
form.contact .row { display: flex; align-items: center; gap: 12px; }
form.contact .msg { font-family: var(--mono); font-size: 12px; color: var(--soft); }
form.contact .msg.err { color: var(--warn); }
form.contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
