/* Article and 404: a yellow top bar (David), then one reading window on Lucy's hair. */

body.page-article::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--yellow);
}

.article-shell { position: relative; z-index: 1; min-height: 100dvh; }

.topbar {
  --fg: var(--ink);
  --fg-2: var(--ink-soft);
  --surface: var(--yellow);
  --link: var(--ink);
  --link-hover: var(--ink);
  --focus: var(--ink);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 11px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  background: var(--yellow);
  color: var(--fg);
  box-shadow: 0 4px 0 var(--trim);
}
.topbar .back { font-weight: 500; }
.topbar__name { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.article-desk {
  padding-block: 44px calc(72px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.win--article { max-width: calc(68ch + 96px); margin-inline: auto; }

.article { display: flex; flex-direction: column; gap: 40px; padding: 40px 48px 44px; min-width: 0; }

.article__head { display: flex; flex-direction: column; gap: 16px; padding-bottom: 28px; border-bottom: 1px solid var(--rule); }
.draft-note {
  align-self: flex-start;
  padding: 4px 10px;
  border: 1px dashed var(--yellow);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--yellow);
}
.article__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--font-mono); font-size: var(--t-xs); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.article__meta time { color: var(--acc-1); }
.article__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.875rem, 5vw, 2.875rem);
  line-height: 1.15;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.article__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--fg-2);
}

/* ---------- prose ---------- */

.prose { display: flex; flex-direction: column; gap: 1.1em; font-size: var(--t-lg); line-height: 1.8; min-width: 0; }
.prose > * { min-width: 0; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; text-wrap: balance; }
.prose h2 { font-size: var(--t-2xl); margin-top: 0.8em; }
.prose h2::before { content: "## "; font-family: var(--font-mono); font-size: 0.6em; color: var(--acc-2); vertical-align: 0.2em; }
.prose h3 { font-size: var(--t-xl); margin-top: 0.5em; }
.prose h4 { font-size: var(--t-lg); }
.prose strong, .prose b { font-weight: 600; color: var(--pale); }
.prose ul, .prose ol { display: flex; flex-direction: column; gap: 0.4em; padding-left: 1.4em; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--acc-1); }
.prose li[data-list="bullet"] { list-style-type: square; }
.prose li[data-list="ordered"] { list-style-type: decimal; }
.prose blockquote { padding: 4px 0 4px 18px; border-left: 2px solid var(--acc-2); color: var(--fg-2); }
.prose code { font-family: var(--font-mono); font-size: 0.86em; padding: 1px 5px; background: var(--void); border: 1px solid var(--rule); color: var(--acc-1); }
.prose pre {
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  line-height: 1.7;
  padding: 16px 18px;
  background: var(--void);
  border-left: 3px solid var(--acc-1);
  overflow-x: auto;
  white-space: pre;
  tab-size: 4;
}
.prose pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
.prose img { border: 1px solid var(--rule); }
.prose hr { border: 0; border-top: 1px dashed var(--line-hi); margin-block: 1em; }
.prose a { overflow-wrap: anywhere; }
.prose .ql-align-center { text-align: center; }
.prose .ql-align-right { text-align: right; }
.prose .ql-align-justify { text-align: justify; }
.prose .ql-indent-1 { padding-left: 2em; }
.prose .ql-indent-2 { padding-left: 4em; }
.prose .ql-indent-3 { padding-left: 6em; }

/* ---------- 404 ---------- */

.nf-desk {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding-block: calc(40px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.win--nf { width: min(100%, 560px); }
.nf { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 32px 32px 36px; }
.nf__code { font-family: var(--font-display); font-weight: 700; font-size: clamp(4.5rem, 16vw, 8rem); line-height: 1; color: var(--yellow); }
.nf h1 { font-family: var(--font-display); font-size: var(--t-2xl); line-height: 1.25; }
.nf p { color: var(--fg-2); }

@media (max-width: 759px) {
  .article-desk { padding-block: 24px calc(48px + env(safe-area-inset-bottom, 0px)); }
  .article { padding: 26px 18px 30px; gap: 30px; }
  .prose { font-size: var(--t-md); }
  .topbar__name { display: none; }
  .nf { padding: 24px 20px 28px; }
}
