/* NTS Journal — Paper and Ink */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/instrument-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/instrument-sans-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: italic; font-weight: 700; font-display: swap; src: url(fonts/instrument-sans-latin-700-italic.woff2) format("woff2"); }

:root {
  --accent: #E2702E;
  --measure: 36rem;
  /* Paper */
  --bg: #F7F4EC;
  --fg: #1B1B1B;
  --muted: #5E5A52;
  --rule: #DCD6C8;
  --soft: #EFEBE0;
}
:root[data-theme="ink"] {
  --bg: #000000;
  --fg: #ECE7DC;
  --muted: #9C978C;
  --rule: #2A2925;
  --soft: #0F0F0E;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) { --bg: #000000; --fg: #ECE7DC; --muted: #9C978C; --rule: #2A2925; --soft: #0F0F0E; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.theme-fade, html.theme-fade * { transition: background-color .28s ease, color .28s ease, border-color .28s ease !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.125rem/1.65 "Instrument Sans", system-ui, sans-serif;
  font-kerning: normal;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 1.25rem;
}
main, .site-head, .site-foot { width: 100%; max-width: var(--measure); margin: 0 auto; }
main { flex: 1; }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: #000; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem .75rem; z-index: 10; }

/* Header */
.site-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2.25rem 0 3rem; gap: 1rem; }
.mark { font-weight: 700; font-style: italic; font-size: 1.6rem; letter-spacing: -0.03em; text-decoration: none; line-height: 1; }
.cursor { color: var(--accent); }
.mark:hover .cursor { animation: blink 1.05s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.site-head nav { display: flex; gap: 1.25rem; font-size: 1rem; }
.site-head nav a { text-decoration: none; color: var(--muted); }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); }

/* Lists of entries */
.intro p { font-size: 1.3rem; line-height: 1.45; margin: 0 0 3rem; max-width: 30rem; }
.section-label { font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--rule); }
.entries, .archive { list-style: none; margin: 0; padding: 0; }
.entry { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.entry-title { font-size: 1.3rem; font-weight: 600; text-decoration: none; line-height: 1.3; }
.entry-title:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.entry-meta { margin: .2rem 0 0; font-size: .9rem; color: var(--muted); }
.sep { margin: 0 .4em; }
.entry-summary { margin: .45rem 0 0; }
.more { margin-top: 1.5rem; }
.empty { color: var(--muted); font-style: italic; }
.draft { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); border: 1px solid currentColor; border-radius: 3px; padding: .05rem .35rem; vertical-align: .15em; }

.page-title { font-size: 2.1rem; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 .5rem; font-weight: 600; }
.lede { color: var(--muted); margin: 0 0 2.5rem; }
.year { margin-bottom: 2.5rem; }
.archive li { display: grid; grid-template-columns: 4.25rem 1fr; gap: .75rem; padding: .45rem 0; }
.archive time { color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; padding-top: .05rem; }
.archive a { text-decoration: none; }
.archive a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* Post */
.post-head { margin-bottom: 2rem; }
.post-head h1 { font-size: 2.25rem; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5rem; font-weight: 600; text-wrap: balance; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.2em; }
.prose h2 { font-size: 1.35rem; font-weight: 600; margin: 2.2em 0 .6em; line-height: 1.3; }
.prose h3 { font-size: 1.1rem; font-weight: 600; margin: 1.8em 0 .5em; }
.prose blockquote { margin-left: 0; padding-left: 1.1rem; border-left: 2px solid var(--fg); font-style: italic; }
.prose hr { border: 0; text-align: center; margin: 2.5rem 0; }
.prose hr::after { content: "· · ·"; color: var(--muted); letter-spacing: .4em; }
.prose img { max-width: 100%; height: auto; }
.prose code { font-size: .9em; background: var(--soft); padding: .1em .3em; border-radius: 3px; }
.prose pre { background: var(--soft); padding: 1rem; overflow-x: auto; border-radius: 4px; font-size: .9rem; }
.prose pre code { background: none; padding: 0; }
.prose li { margin-bottom: .3em; }

/* Callout markers: the numbered balloon from a drawing */
.callout {
  font: 600 .68rem/1 "Instrument Sans", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  width: 1.45em; height: 1.45em;
  min-width: 1.45rem; min-height: 1.45rem;
  padding: 0;
  margin: 0 .1em 0 .15em;
  vertical-align: .35em;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.callout:hover { background: var(--soft); }
.callout[aria-expanded="true"] { background: var(--accent); color: #000; }

/* Notes: open by default without JS; closed by default with it */
.note {
  display: grid;
  grid-template-columns: 1.45rem 1fr;
  gap: .8rem;
  margin: -.4em 0 1.4em;
  padding: .9rem 1rem .9rem .9rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.6;
}
.js .note { display: none; }
.js .note.open { display: grid; }
.note-num {
  font-size: .68rem; font-weight: 600;
  width: 1.45rem; height: 1.45rem;
  border: 1.5px solid var(--accent); border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: .15rem;
}
.note-body > :last-child { margin-bottom: 0; }
.note-body p { margin: 0 0 .9em; }

.elsewhere { margin-top: 2.5rem; font-size: .95rem; color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 3.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.pager a { text-decoration: none; line-height: 1.35; }
.pager a span { display: block; font-size: .8rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .2rem; }
.pager a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.pager .newer { text-align: right; }

/* Monogram as live text, so it changes with the theme like every other word */
.portrait {
  width: 7rem; height: 7rem; border-radius: 50%;
  border: 1.5px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  margin: 0 0 1.5rem;
  font-weight: 700; font-style: italic; font-size: 1.95rem; letter-spacing: -0.03em; line-height: 1;
  user-select: none;
}

/* Footer */
.site-foot { margin-top: 5rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .75rem 1.5rem; font-size: .9rem; color: var(--muted); }
.site-foot p { margin: 0; }
.site-foot .tag { font-style: italic; }
.site-foot .links { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); }

/* Theme switch: right edge, where cursors rest. Version 2 turns this into the inkwell. */
.theme-toggle {
  position: fixed; right: 1.1rem; top: 50%; transform: translateY(-50%);
  width: 2.25rem; height: 2.25rem; padding: 0;
  border: 1.5px solid var(--fg); border-radius: 50%;
  background: var(--bg); cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.js .theme-toggle { display: inline-flex; }
.theme-toggle .well { width: 1rem; height: 1rem; border-radius: 50%; border: 1.5px solid var(--fg); background: linear-gradient(90deg, var(--fg) 50%, transparent 50%); }
.theme-toggle:hover { border-color: var(--accent); }
@media (max-width: 52rem) {
  .theme-toggle { top: auto; bottom: 1rem; transform: none; }
}

@media (max-width: 30rem) {
  body { font-size: 1.0625rem; }
  .site-head { padding: 1.5rem 0 2.25rem; }
  .post-head h1 { font-size: 1.85rem; }
  .page-title { font-size: 1.8rem; }
  .intro p { font-size: 1.15rem; }
  .pager { grid-template-columns: 1fr; }
  .pager .newer { text-align: left; }
  .site-foot { padding-bottom: 4.5rem; }
}

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

@media print {
  .theme-toggle, .site-head nav, .pager, .skip { display: none !important; }
  .js .note { display: grid !important; }
  body { background: #fff; color: #000; }
}
