/* Layout: one calm reading column. Home is a profile then a writing list;
   the timeline hangs entries off a single vertical line. Colours carry over
   the olive and sage of the old Carrd page. */
:root {
  --bg: #f2f3ea;
  --surface: #e6e8d8;
  --fg: #25261c;
  --muted: #6a6953;
  --accent: #74652a;
  --rule: #d4d6c1;
  --mark: #e9e0b0;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --step--1: 0.8rem;
  --step-0: 1.125rem;
  --step-1: 1.35rem;
  --step-2: 1.7rem;
  --step-3: 2.5rem;
  --measure: 38rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171811; --surface: #22241a; --fg: #e4e2cf; --muted: #a09d84;
    --accent: #d0bd72; --rule: #34362a; --mark: #4a4320;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171811; --surface: #22241a; --fg: #e4e2cf; --muted: #a09d84;
  --accent: #d0bd72; --rule: #34362a; --mark: #4a4320;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--step-0)/1.65 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
.page {
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding-block: clamp(2.5rem, 7vw, 5rem) 3rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
img { max-width: 100%; height: auto; }

/* ---------- shared bits ---------- */
.label {
  display: flex; align-items: center; gap: 0.9rem;
  font: 600 var(--step--1)/1 var(--sans);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.label::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.meta, time { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.place { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.more { font: 600 0.9rem/1.4 var(--sans); text-decoration: none; color: var(--accent); align-self: flex-start; }
.more:hover { text-decoration: underline; }
.crumbs { display: flex; gap: 0.6rem; font: 500 0.9rem/1 var(--sans); color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumb-home { color: var(--fg); font-weight: 600; }

.prose { display: flex; flex-direction: column; gap: 1.1em; }
.prose a { color: var(--fg); }
.prose ul, .prose ol { margin: 0; padding-left: 1.3em; }
.prose li + li { margin-top: 0.3em; }
.prose blockquote { margin: 0; padding-left: 1.1em; border-left: 2px solid var(--rule); color: var(--muted); font-style: italic; }
.prose h2 { font: 600 var(--step-1)/1.3 var(--serif); margin-top: 0.6em; }
.prose h3 { font: 600 var(--step-0)/1.4 var(--sans); margin-top: 0.4em; }
.prose hr { border: 0; text-align: center; margin: 0.6em 0; }
.prose hr::after { content: "· · ·"; color: var(--muted); letter-spacing: 0.4em; }
.prose mark { background: var(--mark); color: inherit; padding: 0 0.15em; border-radius: 2px; }
.prose code { font: 0.85em var(--mono); background: var(--surface); padding: 0.1em 0.35em; border-radius: 3px; }
.prose pre { background: var(--surface); padding: 1rem; border-radius: 4px; overflow-x: auto; font-size: 0.85rem; }
.prose pre code { background: none; padding: 0; }
.prose figure { margin: 0.4em 0; display: flex; flex-direction: column; gap: 0.5rem; }
.prose figure img, .prose p > img { display: block; border-radius: 4px; background: var(--surface); }
.prose figcaption { font-size: 0.9rem; font-style: italic; color: var(--muted); }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; font-size: 0.95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 0.4em 0.8em 0.4em 0; text-align: left; }

/* ---------- home ---------- */
.hero { display: flex; align-items: center; gap: 1.4rem; }
.avatar { width: 88px; height: 88px; flex: none; border-radius: 50%; object-fit: cover; background: var(--surface); }
.avatar-initials {
  display: grid; place-items: center;
  font: 500 1.9rem/1 var(--serif); font-style: italic; color: var(--accent);
  border: 1px solid var(--rule);
}
.hero h1 { font: 500 var(--step-3)/1.05 var(--serif); letter-spacing: -0.015em; }
.tagline { margin-top: 0.4rem; font-style: italic; color: var(--muted); font-size: var(--step-1); }
.links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font: 500 0.95rem/1.4 var(--sans); margin-top: -1.25rem; }
.block { display: flex; flex-direction: column; gap: 1.1rem; }

.now { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.now li { position: relative; padding-left: 1.2rem; }
.now li::before { content: "–"; color: var(--accent); position: absolute; left: 0; }
.now a { color: var(--fg); }

.listening { gap: 0.55rem; }
.listening .label { margin-bottom: 0.25rem; }
.track {
  display: flex; align-items: center; gap: 0.8rem;
  text-decoration: none; color: var(--fg);
  align-self: flex-start; max-width: 100%;
}
.cover {
  width: 38px; height: 38px; flex: none; border-radius: 3px;
  background: var(--surface) center / cover no-repeat;
  border: 1px solid var(--rule);
  display: grid; place-items: center;
}
.cover:not(.has-art)::before { content: "\266A"; font-size: 1rem; color: var(--accent); }
.track-text { display: flex; flex-direction: column; min-width: 0; gap: 0; }
.track-status { display: flex; align-items: center; gap: 0.4rem; font: 400 0.68rem/1.5 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.track-name { font: 500 1rem/1.3 var(--serif); overflow-wrap: anywhere; }
.track-artist { font-size: 0.9rem; line-height: 1.35; color: var(--muted); }
.track:hover .track-name { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 0.2em; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 0.65rem; }
.bars i { width: 3px; background: var(--accent); border-radius: 1px; animation: bar 1s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: -0.35s; }
.bars i:nth-child(3) { animation-delay: -0.7s; }
@keyframes bar { 0%, 100% { height: 30%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .bars i { animation: none; height: 70%; } }

.blog-intro { color: var(--muted); font-style: italic; }
.latest { display: flex; flex-direction: column; gap: 0.55rem; padding: 1.4rem 0 0.4rem; }
.latest-kicker { font: 500 0.75rem/1 var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.latest h3 { font: 500 var(--step-2)/1.2 var(--serif); }
.latest h3 a { text-decoration: none; }
.latest h3 a:hover { text-decoration: underline; }
.excerpt { color: var(--fg); }

.entries { list-style: none; margin: 0; padding: 0.4rem 0 0; border-top: 1px solid var(--rule); }
.entries li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.entries a { text-decoration: none; min-width: 0; }
.entries a:hover { text-decoration: underline; }

/* ---------- timeline ---------- */
.page-head { display: flex; flex-direction: column; gap: 0.5rem; }
.page-head h1 { font: 500 var(--step-3)/1.1 var(--serif); letter-spacing: -0.015em; }
.sub { color: var(--muted); }
.year { display: flex; flex-direction: column; gap: 0.6rem; }
.year-num { font: 400 var(--step-2)/1 var(--serif); font-style: italic; color: var(--accent); }
.line { list-style: none; margin: 0; padding: 0; }
.line li { display: grid; grid-template-columns: 4.25rem 1fr; }
.line li time { padding-top: 0.3rem; }
.line-body {
  position: relative; min-width: 0;
  border-left: 1px solid var(--rule);
  padding: 0.15rem 0 1.4rem 1.4rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.line-body::before {
  content: ""; position: absolute; left: -5px; top: 0.7rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--accent);
}
.line li:first-child .line-body::before { background: var(--accent); }
.line-body a { font-size: var(--step-1); line-height: 1.3; text-decoration: none; }
.line-body a:hover { text-decoration: underline; }

/* ---------- post ---------- */
.post { display: flex; flex-direction: column; gap: 2rem; }
.post-head { display: flex; flex-direction: column; gap: 0.7rem; }
.post-head h1 { font: 500 var(--step-3)/1.12 var(--serif); letter-spacing: -0.015em; }
.post-body { font-size: 1.2rem; line-height: 1.72; }
.tags { display: flex; flex-wrap: wrap; gap: 0.6rem; font: 0.82rem var(--mono); color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; border-top: 1px solid var(--rule); padding-top: 1.4rem; }
.pager a { display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; min-width: 0; }
.pager-next { text-align: right; }
.pager-dir { font: 600 0.8rem/1 var(--sans); color: var(--accent); }
.pager-title { line-height: 1.35; }
.pager a:hover .pager-title { text-decoration: underline; }

/* ---------- footer ---------- */
.site-foot {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem;
  padding-top: 1.4rem; border-top: 1px solid var(--rule);
  font: 500 0.85rem/1.4 var(--sans); color: var(--muted);
}
.site-foot span { margin-right: auto; }
.site-foot a { text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .hero { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .avatar { width: 72px; height: 72px; }
  .entries li { grid-template-columns: 1fr; gap: 0.15rem; }
  .post-body { font-size: 1.125rem; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
