:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #0e0e10;
  --ink-soft: #45454d;
  --muted: #8a8a92;
  --rule: #e8e6df;
  --code-bg: #f0eee5;
  --link-hover: #b54309;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max-text: 680px;
  --max-shell: 1180px;
  --gutter: 28px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(14, 14, 16, .28);
  transition: text-decoration-color .15s ease, color .15s ease;
}
a:hover {
  text-decoration-color: var(--ink);
  color: var(--link-hover);
}

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

/* Shell */
.shell {
  max-width: var(--max-shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.text-col {
  max-width: var(--max-text);
  margin: 0 auto;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 250, 247, .9);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover {
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: block;
  width: 11px;
  height: 11px;
  background: var(--ink);
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  gap: 28px;
  align-items: center;
  font-size: 16px;
}
.topnav a {
  color: var(--ink);
  text-decoration: none;
}
.topnav a:hover {
  color: var(--link-hover);
}

/* Featured hero (homepage only) */
.hero {
  display: block;
  position: relative;
  margin: 28px 0 28px;
  border-radius: 16px;
  overflow: hidden;
  min-height: 460px;
  text-decoration: none;
  color: #fff;
  background:
    radial-gradient(110% 90% at 18% 18%, #5b1d8a 0%, transparent 55%),
    radial-gradient(120% 100% at 82% 22%, #d44b1f 0%, transparent 56%),
    radial-gradient(120% 110% at 50% 110%, #1944b3 0%, transparent 60%),
    conic-gradient(from 220deg at 50% 50%, #1d1f8c, #5b1d8a, #b51d8a, #d44b1f, #e08e1c, #1944b3, #1d1f8c);
  filter: saturate(1.05);
  isolation: isolate;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, .55) 100%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 56px 44px 44px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 460px;
  color: #fff;
}

.hero-eyebrow {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .88);
  margin: 0 0 18px;
}

.hero-title {
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 800;
  margin: 0 0 18px;
  max-width: 22ch;
}
.hero-title a {
  color: #fff;
  text-decoration: none;
}
.hero-title a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .6);
}

.hero-dek {
  font-size: 18px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .92);
  max-width: 56ch;
  margin: 0 0 24px;
}

.hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.chip {
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  padding: 4px 12px;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  letter-spacing: 0.02em;
}

/* Section label (rule + uppercase tag) */
.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 80px 0 28px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* Feed items */
.feed {
  padding: 0;
}

.feed-item {
  padding: 28px 0 56px;
  border-top: 1px solid var(--rule);
}
.feed-item:first-of-type {
  border-top: 0;
  padding-top: 12px;
}

.feed-meta {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.feed-title {
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  font-weight: 800;
  margin: 0 0 12px;
  max-width: 24ch;
}
.feed-title a {
  color: var(--ink);
  text-decoration: none;
}
.feed-title a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.feed-dek {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 26px;
  max-width: 60ch;
}

/* Inlined post body inside feed items */
.feed-item .post-body { margin-top: 8px; }

/* Single post page */
.post-page {
  padding: 56px 0 32px;
}

.post-eyebrow {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.post-eyebrow span + span::before {
  content: "·";
  margin-right: 14px;
  color: var(--rule);
}

.post-title {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 800;
  margin: 0 0 22px;
  max-width: 22ch;
}

.post-dek {
  font-size: 21px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 40px;
  max-width: 60ch;
  font-weight: 400;
}

/* Body typography */
.post-body {
  font-size: 18px;
  line-height: 1.75;
  color: #14141a;
}

.post-body p {
  margin: 0 0 22px;
}

.post-body > p:first-of-type::first-letter {
  font-size: 4.4em;
  float: left;
  line-height: 0.9;
  margin: 0.04em 0.1em 0 -0.04em;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.post-body h2 {
  font-size: clamp(22px, 2.4vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.012em;
  font-weight: 800;
  margin: 52px 0 14px;
}

.post-body h3 {
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 40px 0 12px;
  font-weight: 700;
}

.post-body ul,
.post-body ol {
  margin: 0 0 22px;
  padding-left: 22px;
}
.post-body li { margin: 0 0 8px; }

.post-body code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
}

.post-body pre {
  background: #0e0e10;
  color: #f4efe3;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 18px 20px;
  border-radius: 8px;
  overflow: auto;
  margin: 0 0 26px;
}
.post-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.post-body blockquote {
  margin: 28px 0;
  padding: 0 0 0 22px;
  border-left: 3px solid var(--ink);
  color: var(--ink-soft);
  font-style: italic;
}

.post-body strong {
  font-weight: 700;
  color: var(--ink);
}

/* Section divider (3 small diamonds) */
.divider {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 64px auto;
}
.divider span {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--rule);
  transform: rotate(45deg);
}

/* About / utility pages */
.page {
  padding: 56px 0 24px;
}
.page h1 {
  font-size: clamp(32px, 4.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  font-weight: 800;
  margin: 0 0 26px;
  max-width: 22ch;
}
.page p {
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 18px;
  max-width: 60ch;
}

/* Footer */
.foot {
  margin: 96px 0 56px;
  padding: 32px 0 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 16px;
  color: var(--ink);
}
.foot a {
  color: var(--ink);
  text-decoration: none;
}
.foot a:hover {
  color: var(--link-hover);
}

.foot-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.foot-mark span.diamond {
  display: block;
  width: 9px;
  height: 9px;
  background: var(--ink);
  transform: rotate(45deg);
}

/* 404 */
.lost {
  text-align: center;
  padding: 140px 24px 100px;
}
.lost-mark {
  display: inline-block;
  width: 26px;
  height: 26px;
  background: var(--ink);
  transform: rotate(45deg);
  margin-bottom: 32px;
}
.lost h1 {
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.018em;
  font-weight: 800;
  margin: 0 0 12px;
}
.lost p {
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0 auto 20px;
}

/* Mobile */
@media (max-width: 760px) {
  :root { --gutter: 20px; }
  html, body { font-size: 16px; }
  .topbar-inner { padding-top: 14px; padding-bottom: 14px; }
  .topnav { gap: 18px; }

  .hero { min-height: 380px; border-radius: 12px; margin-top: 22px; }
  .hero-inner { padding: 36px 24px 32px; min-height: 380px; }
  .hero-dek { font-size: 16px; }

  .feed-item { padding-bottom: 44px; }
  .feed-dek { font-size: 17px; }

  .post-page { padding: 36px 0 24px; }
  .post-body { font-size: 17px; }
  .post-body > p:first-of-type::first-letter { font-size: 3.4em; }
  .post-body h2 { margin-top: 40px; }

  .section-label { margin: 56px 0 22px; }
  .foot { margin-top: 64px; }
}
