/* idleloop notes — plain paper, amber accent, mono for the parts
   that identify things and none for the parts you read. */

:root {
  --paper: #fcfbf8;
  --ink: #2b2b28;
  --muted: #75746c;
  --rule: #e5e3dc;
  --accent: #a16207;
  --code-bg: #f4f3ed;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 70ch;
  padding: 0 1.25rem;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.7 system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* header */

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .25rem 1rem;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  font: 600 1rem/1.4 var(--mono);
  letter-spacing: .03em;
  color: var(--ink);
}
.brand:hover { color: var(--ink); text-decoration: none; }

.cursor { display: inline-block; width: .5em; height: 1em; margin-left: .3em; vertical-align: -.15em; background: var(--accent); }
.brand:hover .cursor { background: var(--ink); }

nav { font: .9rem/1.4 var(--mono); color: var(--muted); }
nav a { color: var(--muted); }
nav a:hover { color: var(--accent); }

/* lists */

.lede { color: var(--muted); margin: 1.75rem 0; }

.page-title {
  font: 600 1.15rem/1.4 var(--mono);
  margin: 1.75rem 0 .5rem;
}

.postlist article {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--rule);
}

.postlist h2 { flex: 1 1 auto; margin: 0; font-size: 1.05rem; font-weight: 600; }
.postlist h2 a { color: var(--ink); }
.postlist h2 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.postlist time { flex: none; font: .85rem/1.6 var(--mono); color: var(--muted); }

/* posts */

.back { margin-top: 1.5rem; font: .85rem/1.4 var(--mono); }
.back a { color: var(--muted); }
.back a:hover { color: var(--accent); }

.post h1 {
  font: 600 1.3rem/1.45 var(--mono);
  margin: 1.25rem 0 .25rem;
}

.post time {
  display: block;
  font: .85rem/1.6 var(--mono);
  color: var(--muted);
  margin-bottom: 1.75rem;
}

.post p { margin: 0 0 1.1rem; }

pre {
  margin: 1.4rem 0;
  padding: .85rem 1rem;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  font: .85rem/1.65 var(--mono);
}

code { font-family: var(--mono); font-size: .85em; }

/* footer */

footer {
  margin: 3.5rem 0 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font: .85rem/1.6 var(--mono);
  color: var(--muted);
}

/* 404 gets a blinking cursor. because of course it does. */

.error h1 { color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
  .error h1::after {
    content: "";
    display: inline-block;
    width: .45em;
    height: .95em;
    margin-left: .4em;
    vertical-align: -.08em;
    background: var(--accent);
    animation: blink 1.1s steps(1) infinite;
  }
  @keyframes blink { 50% { background: transparent; } }
}

/* phones */

@media (max-width: 34rem) {
  .postlist article { flex-wrap: wrap; gap: .15rem 1rem; }
  .postlist time { flex-basis: 100%; }
}

/* paper gradient + falling leaves (bg.js) */
body { background: linear-gradient(165deg, #fbfdf8 0%, #eef5e4 55%, #dfeacf 100%) fixed; }
.leaves { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.leaves i {
  position: absolute; top: -6vh;
  border-radius: 0 100% 0 100%;
  animation: fall linear infinite;
}
@keyframes fall {
  0%   { transform: translate3d(0, -6vh, 0) rotate(0deg); }
  25%  { transform: translate3d(var(--sway), 22vh, 0) rotate(90deg); }
  50%  { transform: translate3d(calc(var(--sway) * -0.6), 50vh, 0) rotate(200deg); }
  75%  { transform: translate3d(var(--sway), 78vh, 0) rotate(300deg); }
  100% { transform: translate3d(0, 110vh, 0) rotate(420deg); }
}
@media (prefers-reduced-motion: reduce) { .leaves { display: none; } }
