:root {
  --bg: #f5f4ef;
  --ink: #17171a;
  --muted: #6b6b6b;
  --accent: #e2542a;
  --accent-ink: #ffffff;
  --line: #17171a;
  --footer-bg: #17171a;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

a {
  color: inherit;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--ink);
}

.logo .badge {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.1rem;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
}

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

/* Hero */
.hero {
  padding: 3.5rem 1.5rem 3rem;
  border-bottom: 1px solid var(--line);
}

.hero-kicker {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  max-width: 20ch;
}

.hero p {
  color: var(--muted);
  max-width: 42ch;
  margin: 0 0 1.75rem;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.25rem;
  border-radius: 4px;
  font-size: 0.95rem;
}

.btn:hover {
  opacity: 0.9;
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.category-card {
  padding: 2rem 1.5rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:nth-child(2n) {
  border-right: none;
}

.category-card:nth-child(3),
.category-card:nth-child(4) {
  border-bottom: none;
}

.category-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
}

.category-card h3 {
  font-size: 1.4rem;
  margin: 0 0 0.4rem;
}

.category-card p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
}

/* Recent posts */
.recent {
  padding: 2.5rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.recent-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.recent-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.recent-header a {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.9rem;
  text-decoration: none;
}

.post-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.85rem 0;
  border-top: 1px solid #e0dfd8;
  gap: 1rem;
}

.post-row:last-child {
  border-bottom: 1px solid #e0dfd8;
}

.post-row-title {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  min-width: 0;
}

.post-row-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.post-row a {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}

.post-row a:hover {
  color: var(--accent);
}

.post-row-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  background: var(--footer-bg);
  color: #f5f4ef;
  padding: 3rem 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-footer .quote {
  max-width: 34ch;
  font-size: 1rem;
  line-height: 1.6;
}

.site-footer .quote cite {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-style: normal;
  color: var(--accent);
  font-size: 0.85rem;
}

.footer-signoff {
  text-align: right;
}

.footer-ring {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid var(--accent);
  border-radius: 50%;
  margin-left: auto;
  margin-bottom: 0.75rem;
}

.footer-signoff strong {
  display: block;
  font-size: 1.05rem;
}

.footer-signoff span {
  display: block;
  font-family: var(--mono);
  color: #9a9a9a;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

/* Generic page / post content */
.page-content {
  padding: 3rem 1.5rem;
  max-width: 720px;
  margin: 0 auto;
}

.page-content h1 {
  font-size: 2rem;
  margin-top: 0;
}

.post-meta {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.page-content img {
  max-width: 100%;
  border-radius: 4px;
}

/* Category labels / tags */
.labels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 1.75rem;
}

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.label:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Long-form post content */
.post-body {
  font-size: 1.05rem;
  line-height: 1.75;
}

.post-body h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 0.75rem;
}

.post-body h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

.post-body p {
  margin: 0 0 1.25rem;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.25rem 1.5rem;
}

.post-body li {
  margin-bottom: 0.4rem;
}

.post-body blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: #eceae2;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
}

.post-body pre {
  background: #17171a;
  color: #f5f4ef;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.post-body figure {
  margin: 1.75rem 0;
}

.post-body figcaption {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  text-align: center;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.post-body th,
.post-body td {
  border: 1px solid #ddd;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.post-body hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2rem 0;
}

/* Responsive 16:9 video embed */
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.75rem 0;
  border-radius: 6px;
  overflow: hidden;
  background: #17171a;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Simple prose for about/work/stuff/contact */
.prose {
  font-size: 1.05rem;
  line-height: 1.7;
}

.prose h2 {
  margin-top: 2rem;
  font-size: 1.4rem;
}

.prose ul {
  margin-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

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

/* Comments block */
.comments {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0dfd8;
}

.comments h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
  .category-card:nth-child(2n) {
    border-right: 1px solid var(--line);
  }
  .category-card:nth-child(3) {
    border-bottom: 1px solid var(--line);
  }
  .site-footer {
    flex-direction: column;
  }
  .footer-signoff {
    text-align: left;
  }
  .footer-ring {
    margin-left: 0;
  }
}
