/* Sharp#Soft articles — minimal stylesheet (brand palette per assets/STYLE-GUIDE.md). */

:root {
  --c-bg: #000100;
  --c-green: #64832C;
  --c-blue: #3C5796;
  --c-purple: #791142;
  --c-gray: #C0C0C0;
  --c-text: #E8E8E8;
  --c-muted: #8A8A8A;
  --c-rule: #2A2A2A;
  --c-card: #0A0B0A;
  /* Fluid widths: never touch the edges on small screens (Xvw), capped for readability on large.
     Prose caps ~820px (≈ comfortable line length); wide layouts (home, indexes) scale further. */
  --max-w: min(92vw, 820px);
  --max-w-wide: min(94vw, 1140px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--c-green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}
a:hover, a:focus { border-bottom-color: var(--c-green); }

header.site, footer.site {
  border-bottom: 1px solid var(--c-rule);
  background: var(--c-bg);
}
footer.site { border-bottom: none; border-top: 1px solid var(--c-rule); margin-top: 4rem; }

.site-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--c-text);
  border-bottom: none;
}
.brand .mark { color: var(--c-green); }

.site nav a {
  margin-left: 1.25rem;
  color: var(--c-gray);
  font-size: 0.95rem;
}
.site nav a:first-child { margin-left: 0; }

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

main.wide { max-width: var(--max-w-wide); }

article header.piece {
  margin-bottom: 2.5rem;
}

article header.piece .meta {
  color: var(--c-muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

article header.piece h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 0.6rem;
  color: var(--c-text);
  font-weight: 700;
  letter-spacing: -0.01em;
}

article header.piece .subtitle {
  color: var(--c-gray);
  font-size: 1.15rem;
  margin: 0;
}

article .body h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.45rem;
  color: var(--c-text);
  letter-spacing: -0.005em;
}

article .body h3 {
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  font-size: 1.15rem;
  color: var(--c-gray);
}

article .body p { margin: 0 0 1.1rem; }

article .body blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 1.2rem;
  border-left: 3px solid var(--c-purple);
  color: var(--c-gray);
  font-style: normal;
}

article .body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.92em;
}

article .body pre {
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  line-height: 1.5;
  font-size: 0.92rem;
}
article .body pre code { background: none; border: none; padding: 0; }

article .body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 4px;
}

article .body ul, article .body ol { padding-left: 1.4rem; }
article .body li { margin-bottom: 0.35rem; }

article .body hr {
  border: none;
  border-top: 1px solid var(--c-rule);
  margin: 2.5rem 0;
}

.related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-rule);
}
.related h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-muted);
  margin: 0 0 0.8rem;
}
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin-bottom: 0.3rem; }

.subscribe-block {
  margin-top: 3rem;
  padding: 1.8rem 1.5rem;
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  border-radius: 6px;
}
.subscribe-block h3 {
  margin: 0 0 0.4rem;
  color: var(--c-text);
  font-size: 1.1rem;
}
.subscribe-block p {
  color: var(--c-gray);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

footer.piece-end {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-rule);
  color: var(--c-muted);
  font-size: 0.9rem;
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.article-list li {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--c-rule);
}
.article-list li:first-child { padding-top: 0; }
.article-list li:last-child { border-bottom: none; }
.article-list .item-meta {
  color: var(--c-muted);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.article-list h2 {
  font-size: 1.35rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
}
.article-list h2 a {
  color: var(--c-text);
  border-bottom: none;
}
.article-list h2 a:hover, .article-list h2 a:focus {
  color: var(--c-green);
}
.article-list .item-summary {
  color: var(--c-gray);
  margin: 0;
  font-size: 0.98rem;
}

.tag {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--c-gray);
  background: var(--c-card);
  border: 1px solid var(--c-rule);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.3rem;
}

footer.site .site-inner {
  color: var(--c-muted);
  font-size: 0.88rem;
  justify-content: space-between;
}
footer.site a { color: var(--c-gray); }

@media (max-width: 640px) {
  body { font-size: 17px; }
  article header.piece h1 { font-size: 1.7rem; }
  article .body h2 { font-size: 1.3rem; }
  main { padding: 1.8rem 1.2rem 2.5rem; }
  .site-inner { padding: 1rem 1.2rem; }
  .site nav a { margin-left: 0.9rem; font-size: 0.9rem; }
}

/* Large screens: use the extra space — wider reading measure and a touch larger type. */
@media (min-width: 1280px) {
  body { font-size: 19px; }
  :root { --max-w: min(90vw, 880px); --max-w-wide: min(92vw, 1240px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
