/*
 * Adapted from kepano/slashpackaging (MIT, Copyright 2022 Stephan Ango):
 * _variables.scss, _style.scss, content/_headings.scss, content/_links.scss,
 * components/_theme-toggle.scss. See LICENSES/slashpackaging.txt.
 * Palette values from Flexoki (MIT, Copyright 2023 Steph Ango).
 * See LICENSES/flexoki.txt. Layout and accessible controls adapted for this site.
 */
:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --paragraph-max-width: 35em;
  --color-background-primary: #fffcf0;
  --color-background-secondary: #f2f0e5;
  --color-primary: #100f0f;
  --color-muted: #6f6e69;
  --color-action: #205ea6;
  --color-outline: #dad8ce;
  --color-selection: #c6dde8;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --color-background-primary: #100f0f;
  --color-background-secondary: #1c1b1a;
  --color-primary: #cecdc3;
  --color-muted: #9f9d96;
  --color-action: #66a0c8;
  --color-outline: #403e3c;
  --color-selection: #163b66;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-background-primary: #100f0f;
    --color-background-secondary: #1c1b1a;
    --color-primary: #cecdc3;
    --color-muted: #9f9d96;
    --color-action: #66a0c8;
    --color-outline: #403e3c;
    --color-selection: #163b66;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html { box-sizing: border-box; background: var(--color-background-primary); scrollbar-color: var(--color-outline) var(--color-background-primary); scrollbar-gutter: stable; }
body {
  color: var(--color-primary);
  font-family: var(--font-family);
  font-size: clamp(17px, 1rem + .15vw, 19px);
  line-height: 1.6;
  margin: 0 auto;
  max-width: calc(var(--paragraph-max-width) + 4rem);
  padding: 2.5rem 2rem 1.5rem;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
::selection { background: var(--color-selection); }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-action); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--color-action); outline-offset: 5px; border-radius: 2px; }
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 3.75rem; }
.site-header a { text-decoration: none; }
/* Header and plain-link treatment follow slashpackaging's nav and _links.scss. */
.site-identity { display: flex; align-items: baseline; gap: .35em; white-space: nowrap; }
.site-name { font-weight: 400; }
.breadcrumb-separator, .breadcrumb { color: var(--color-muted); }
a.plain { text-decoration: none; border: none; background-color: transparent; box-shadow: none; }
.site-header nav { display: flex; align-items: center; gap: 1.25rem; color: var(--color-muted); margin-left: auto; }
.site-header [aria-current] { color: var(--color-primary); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { line-height: 1.3; text-wrap: balance; font-weight: 500; }
h1 { font-size: clamp(1.65rem, 1.3rem + 1vw, 2.1rem); letter-spacing: -.02em; margin: 0 0 .5rem; }
h2 { font-size: 1.3em; letter-spacing: -.015em; margin: 2rem 0 .65rem; }
h3 { font-size: 1.08em; margin: 1.5rem 0 .5rem; }
h1 a, h3 a { text-decoration: none; }
h1 a:hover, h3 a:hover { text-decoration: underline; }
p { margin: 1rem 0; }
time, .muted, .summary { color: var(--color-muted); }
time { font-size: .875em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.article-header { margin-bottom: 2rem; }
.article-header .summary { margin-top: .6rem; }
.latest-post .prose { margin: 1rem 0; }
.read-more { color: var(--color-muted); white-space: nowrap; }
.read-more:hover { color: var(--color-action); }
.home-section { margin-top: 2.75rem; padding-top: 2rem; border-top: 1px solid var(--color-outline); }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-heading h2, .home-section > h2 { margin: 0; }
.section-heading > a { font-size: .85em; color: var(--color-muted); }
.project-list, .writing-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.project-list > li { padding: 1.1rem 0; border-bottom: 1px solid var(--color-outline); }
.project-list > li:last-child { border-bottom: 0; }
.project-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.project-heading h3 { margin: 0; }
.project-list p { margin: .4rem 0 0; color: var(--color-muted); font-size: .94em; }
.writing-list li { display: grid; grid-template-columns: 6.3rem 1fr; gap: 1rem; padding: .35rem 0; }
.prose img, .prose video { max-width: 100%; height: auto; border-radius: 4px; }
.prose pre { overflow-x: auto; padding: 1rem; background: var(--color-background-secondary); border-radius: 4px; }
code { font-size: .875em; background: var(--color-background-secondary); padding: .1em .25em; border-radius: 3px; }
pre code { padding: 0; }
blockquote { border-left: 1px solid var(--color-outline); margin: 1.5rem 0; padding-left: 1.25rem; color: var(--color-muted); }
.prose table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; font-size: .9em; }
th, td { text-align: left; padding: .6rem; border-bottom: 1px solid var(--color-outline); }
hr { border: 0; border-top: 1px solid var(--color-outline); margin: 2rem 0; }
.timeline { border-top: 1px solid var(--color-outline); margin-top: 2.5rem; padding-top: .25rem; }
.timeline dl { margin: 1rem 0; }
.timeline dl > div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; margin: .35rem 0; }
.timeline dt { color: var(--color-muted); }
.timeline dd { margin: 0; }
.back-link { margin-top: 2.5rem; font-size: .9em; }
.site-footer { margin-top: 4rem; padding-top: 1.3rem; border-top: 1px solid var(--color-outline); display: flex; justify-content: space-between; gap: 1rem; font-size: .8em; color: var(--color-muted); }
.site-footer a { text-decoration: none; }
#theme-toggle { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; color: inherit; }
#theme-toggle[hidden] { display: none; }
.theme-track { display: block; width: 36px; height: 20px; margin: auto; border: 1px solid var(--color-muted); border-radius: 24px; position: relative; }
.theme-knob { position: absolute; left: 1px; top: 1px; width: 16px; height: 16px; color: var(--color-muted); transition: transform .12s ease-out; }
.theme-knob svg { display: block; width: 100%; height: 100%; }
.theme-knob .theme-moon { display: none; }
[data-theme="dark"] .theme-knob { transform: translateX(16px); color: var(--color-primary); }
[data-theme="dark"] .theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: block; }
#theme-toggle:hover .theme-knob { color: var(--color-action); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: -5rem; background: var(--color-background-primary); padding: .5rem; }
.skip-link:focus { top: .5rem; }
@media (max-width: 480px) {
  body { padding: 1.25rem 1.25rem 1.5rem; }
  .site-header { margin-bottom: 2.5rem; gap: .5rem; }
  .site-header nav { gap: .75rem; }
  .project-heading { flex-direction: column; gap: .25rem; }
  .writing-list li { grid-template-columns: 1fr; gap: 0; padding: .6rem 0; }
}
@media (prefers-reduced-motion: reduce) { .theme-knob { transition: none; } }
