/* jace.sh — hand-written stylesheet, no build step. */

:root {
  --brand: #22946c;
  --brand-tint: rgba(34, 148, 108, 0.05);

  --zinc-100: #f4f4f5;
  --zinc-200: #e4e4e7;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-900: #18181b;


  --content-width: 48rem;
  --gutter: 1rem;
  --gutter-wide: 3rem;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

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

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--zinc-100);
  color: var(--zinc-900);
  font-family: var(--font-sans);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.icon {
  display: inline-block;
  vertical-align: middle;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
}

/* ---------- header ---------- */

.site-header {
  padding-inline: var(--gutter);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--zinc-300);
}

.brand-badge {
  padding-inline: 0.5rem;
  border-radius: 9999px;
  background-color: var(--brand-tint);
  color: var(--brand);
  font-weight: 500;
  line-height: 1.5rem;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--brand);
}

/* ---------- layout ---------- */

.site-main {
  flex: 1;
  padding-inline: var(--gutter);
}

.content {
  max-width: var(--content-width);
  margin-inline: auto;
  padding-block: 0.5rem;
}

.site-footer {
  padding-inline: var(--gutter);
}

.site-footer p {
  margin: 0;
  padding-block: 0.75rem;
  border-top: 1px solid var(--zinc-300);
  text-align: center;
  font-size: 0.875rem;
}

/* ---------- home ---------- */

.about {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-block: 0.5rem;
}

.about__portrait {
  width: 14rem;
  height: 14rem;
  border-radius: 9999px;
  object-fit: cover;
  filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03))
    drop-shadow(0 8px 5px rgb(0 0 0 / 0.08));
}

.about__text p {
  margin: 0 0 1rem;
}

.about__text p:last-child {
  margin-bottom: 0;
}

.about__text a,
.not-found a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.about__text a:hover,
.not-found a:hover {
  text-decoration: underline;
}

/* ---------- headings ---------- */

.page-title {
  margin: 0;
  padding-top: 0.5rem;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
}

.about__text h1 {
  margin: 0;
  padding-block: 0.5rem;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
}

/* ---------- blog index ---------- */

.post-list {
  margin: 0;
  padding: 0.75rem 0;
  list-style: none;
}

.post-list li {
  padding: 0.25rem;
}

.post-card {
  display: block;
  padding: 0.5rem;
  border: 2px dotted var(--zinc-400);
  text-decoration: none;
}

.post-card:hover {
  border-color: var(--brand);
}

.post-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
}

.post-card__title {
  padding-block: 0.25rem;
}

.post-card__date {
  font-size: 0.875rem;
  white-space: nowrap;
}

.post-card__desc {
  margin: 0;
  padding-block: 0.25rem;
  font-style: italic;
}

/* ---------- post ---------- */

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
}

.post-meta .icon {
  width: 1.5rem;
  height: 1.5rem;
}

#post-body p {
  margin: 0;
  padding-bottom: 1rem;
}

#post-body a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

#post-body a:hover {
  text-decoration: underline;
}

#post-body h2 {
  margin: 0;
  padding-block: 0.25rem;
  font-size: 1.25rem;
  font-weight: 700;
}

#post-body h3 {
  margin: 0;
  padding-block: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

#post-body ul,
#post-body ol {
  padding-left: 1.5rem;
  margin: 0 0 1rem;
}

#post-body blockquote {
  margin: 0 0 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--zinc-400);
  color: #52525b;
}

#post-body img {
  height: 250px;
  width: auto;
  margin-inline: auto;
  padding-bottom: 1rem;
}

/* inline code */
#post-body :not(pre) > code {
  padding: 0.125rem 0.25rem;
  background-color: var(--zinc-200);
  border-radius: 3px;
}

#post-body pre {
  margin: 0 0 1rem;
  padding: 1em;
  white-space: pre-wrap;
  word-break: break-word;
  border: 2px solid var(--zinc-400);
  background-color: #f3f3f3;
}

/* Chroma wraps each source line in a flex row; keep long lines wrapping
   the way the old highlight.js + pre-wrap setup did. */
#post-body .chroma-line {
  display: block;
}

/* ---------- footnotes ---------- */

.footnotes {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--zinc-300);
  font-size: 0.875rem;
}

.footnotes ol {
  padding-left: 1.25rem;
}

.footnote-ref a,
.footnote-backref {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

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

.not-found {
  padding-block: 1rem;
}

/* ---------- responsive ---------- */

@media (min-width: 640px) {
  :root {
    --gutter: 1.5rem;
  }

  .about {
    flex-wrap: nowrap;
    gap: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .site-header,
  .site-footer {
    padding-inline: var(--gutter-wide);
  }

  .site-main {
    padding-inline: 2rem;
  }
}
