/* roman.jetzt: one column, Inter, neutral greys (shadcn's neutral scale), no accent colour. */

@font-face {
  font-family: Inter;
  src: url(/fonts/inter.woff2) format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url(/fonts/inter-italic.woff2) format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --background: #ffffff;
  --foreground: #0a0a0a;        /* names, headings, links */
  --body: #525252;              /* running text, 7.8:1 on white */
  --muted-foreground: #6b6b6b;  /* meta text, 5.3:1 on white, 4.9:1 on the hover background */
  --muted: #f5f5f5;             /* hover background */
  --border: #e5e5e5;            /* hairlines */
  --underline: rgb(10 10 10 / 22%);
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  box-sizing: content-box;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(48px, 10vh, 96px) clamp(20px, 6vw, 60px) 0;
  background: var(--background);
  color: var(--body);
  font: 16px/1.6 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--foreground); font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0 0 12px; }

a {
  color: var(--foreground);
  text-decoration-line: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color .15s;
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--foreground); outline-offset: 2px; border-radius: 4px; }

.meta { color: var(--muted-foreground); font-size: 14px; }
.meta a { color: inherit; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 8px;
  color: var(--body);
  font-size: 12px;
  font-weight: 500;
}

/* Homepage */

.intro h1 { margin: 0 0 16px; font-size: 20px; }

.group { margin-top: 64px; }
.group > h2 { margin: 0 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 14px; }

.chapter { display: grid; grid-template-columns: 9rem 1fr; gap: 0 24px; margin-bottom: 24px; }
.chapter > .meta { padding-top: 12px; }

.row { position: relative; margin: 0 -12px; padding: 12px; border-radius: var(--radius); transition: background .15s; }
.row:hover { background: var(--muted); }
.row:has(a:focus-visible) { outline: 2px solid var(--foreground); outline-offset: 2px; }
.row h3 { margin: 0; font-size: 16px; }
.row h3 a { text-decoration: none; }
.row h3 a::after { content: ''; position: absolute; inset: 0; }  /* the whole row is clickable */
.row h3 a:focus-visible { outline: none; }
.row p { margin: 2px 0 10px; }
.row p.meta { margin: -6px 0 10px; font-size: 13px; }

@media (max-width: 640px) {
  .chapter { grid-template-columns: 1fr; }
  .chapter > .meta { padding-top: 0; }
}

/* Article pages */

.back { color: var(--muted-foreground); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--foreground); }

.post-header { margin: 32px 0 40px; }
.post-header h1 { margin: 0 0 4px; font-size: 24px; }
.post-header .meta { margin-bottom: 16px; }
.post-header .lede { margin-bottom: 16px; color: var(--body); font-size: 17px; }

.prose { font-size: 17px; line-height: 1.7; overflow-wrap: break-word; }  /* long links wrap on narrow phones */
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 20px; }
.prose h2 { margin: 56px 0 12px; font-size: 20px; }
.prose h3 { margin: 36px 0 8px; font-size: 17px; }
.prose :is(h2, h3) { position: relative; }
.prose :is(h2, h3) > a:empty::before {            /* "#" anchor on hover */
  content: '#';
  position: absolute;
  left: -0.9em;
  color: var(--muted-foreground);
  font-weight: 400;
  opacity: 0;
}
.prose :is(h2, h3):hover > a:empty::before, .prose a:empty:focus-visible::before { opacity: 1; }
@media (hover: none) { .prose :is(h2, h3) > a:empty::before { opacity: .5; } }  /* phones have no hover */
.prose strong { color: var(--foreground); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin: 6px 0; }
.prose li p { margin: 0; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 2px solid var(--border); color: var(--foreground); font-style: italic; }
.prose blockquote p { margin: 0; }
.prose code { padding: .15em .4em; border-radius: 6px; background: var(--muted); color: var(--foreground); font: .875em ui-monospace, SFMono-Regular, Menlo, monospace; }
.prose img { display: block; max-width: 100%; height: auto; margin: 32px 0 0; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--border); }
.prose p:has(> img) { margin-bottom: 32px; }
.prose img + em { display: block; margin-top: 10px; color: var(--muted-foreground); font-size: 14px; font-style: normal; line-height: 1.5; }
.prose iframe { border-radius: var(--radius); }

/* Footer */

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 76px;
  padding: 24px 0 48px;
  border-top: 1px solid var(--border);
}
footer nav { display: flex; gap: 16px; }

/* Motion: a short fade-in on load and a crossfade between pages, off with reduced motion */

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  main > * { animation: enter .5s ease-out both; }
  main > :nth-child(2) { animation-delay: .06s; }
  main > :nth-child(3) { animation-delay: .12s; }
  main > :nth-child(n + 4) { animation-delay: .18s; }
  @keyframes enter { from { opacity: 0; transform: translateY(6px); } }
}
