@layer reset, tokens, base, layout, components, utilities;

@import url('/_public/css/reset.css') layer(reset);
@import url('/_public/css/tokens.css') layer(tokens);
@import url('/_public/css/base.css') layer(base);
@import url('/_public/css/atom-one-dark.css') layer(components);

/* Page shell ------------------------------------------------------- */
.page {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* Navigation (layout lives in site-nav) ---------------------------- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1.75rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-strong);
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
}

.nav-links a {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--pop);
}

.nav-links a.active {
  color: var(--fg-strong);
}

/* Shared text pieces ----------------------------------------------- */
.page-title {
  font-size: var(--text-title);
  margin: 0 0 1rem;
}

.section-title {
  font-size: var(--text-h3);
  margin: 0 0 0.75rem;
}

.text-link {
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.text-link:hover {
  color: var(--pop);
  text-decoration-color: currentcolor;
}

/* Homepage intro --------------------------------------------------- */
.intro {
  margin-block: 1.5rem 4rem;
}

.intro-bio {
  max-width: 36rem;
  font-size: var(--text-base);
  color: var(--fg-muted);
  margin: 0;
}

.intro-links {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin-top: 1rem;
}

/* Post list (home, posts index, end of post) ----------------------- */
.post-list {
  list-style: none;
  margin: 0;
}

.post-list li {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding-block: 0.75rem;
  border-top: 1px solid var(--border);
}

.post-list time {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-list a {
  font-size: var(--text-base);
  transition: color 0.15s;
}

.post-list a:hover {
  color: var(--pop);
}

.post-list-empty {
  color: var(--fg-muted);
}

@media (width <= 30rem) {
  .post-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
}

/* Article (post, about, uses) -------------------------------------- */
.article {
  max-width: var(--measure);
}

.article-back {
  display: inline-block;
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}

.article-back:hover {
  color: var(--pop);
}

.article-meta {
  font-size: var(--text-sm);
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
}

.article-more {
  margin-top: 4rem;
}

/* Prose ------------------------------------------------------------ */
.prose > * + * {
  margin-top: 1.25rem;
}

.prose p,
.prose li {
  font-size: var(--text-base);
  line-height: 1.8;
}

.prose h2 {
  font-size: var(--text-h2);
  margin-top: 2.5rem;
}

.prose h3 {
  font-size: var(--text-h3);
  margin-top: 2rem;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 0.75rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.prose a:hover {
  color: var(--pop);
}

.prose :not(pre) > code {
  font-size: 0.9em;
  background: var(--code-inline-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.prose blockquote {
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  color: var(--fg-muted);
}

.prose hr {
  border-top: 1px solid var(--border);
  margin-block: 2.5rem;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Code block (always dark) ----------------------------------------- */
.code-block {
  background: var(--code-block-bg);
  color: var(--code-block-fg);
  border-radius: 6px;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: oklch(72% 0 0deg);
}


.code-filename {
  overflow-wrap: anywhere;
}

.code-block pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
}

.code-block code,
.code-block .hljs {
  display: block;
  font-size: var(--text-code);
  line-height: 1.7;
  background: none;
  padding: 0;
  white-space: pre;
}

/* Atom One Dark's comment grey fails contrast on the block background */
.code-block .hljs-comment,
.code-block .hljs-quote {
  color: oklch(68% 0 0deg);
}

/* Uses ------------------------------------------------------------- */
.uses-intro {
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
}

.uses-category + .uses-category {
  margin-top: 2.5rem;
}

.uses-list {
  list-style: none;
}

.uses-item {
  padding-block: 0.75rem;
  border-top: 1px solid var(--border);
}

.uses-item-name {
  font-weight: 500;
}

.uses-item-name a {
  transition: color 0.15s;
}

.uses-item-name a:hover {
  color: var(--pop);
}

.uses-item-desc {
  color: var(--fg-muted);
  margin: 0.15rem 0 0;
}
