:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --paper: #fffdf8;
  --ink: #171717;
  --muted: #67645e;
  --line: #ded8cb;
  --accent: #0f766e;
  --accent-dark: #11413d;
  --warm: #c94a2b;
  --shadow: 0 24px 80px rgba(42, 37, 28, 0.12);
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 32rem),
    linear-gradient(315deg, rgba(201, 74, 43, 0.08), transparent 34rem),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
}

.site-nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: #34322f;
  font-size: 0.92rem;
  font-weight: 600;
}

.site-nav a:hover {
  background: rgba(255, 253, 248, 0.78);
  color: var(--accent-dark);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  background: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.03;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 880px;
  font-size: clamp(3rem, 8vw, 6.8rem);
}

.lead {
  max-width: 720px;
  margin: 1.4rem 0 0;
  color: #3f3c37;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.78rem 1.05rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-weight: 800;
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
}

.button.secondary {
  background: rgba(255, 253, 248, 0.58);
}

.hero-panel {
  position: relative;
  align-self: stretch;
  min-height: 520px;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.04);
}

.signal-card {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(280px, calc(100% - 36px));
  padding: 1rem;
  border: 1px solid rgba(255, 253, 248, 0.5);
  background: rgba(23, 23, 23, 0.88);
  color: var(--paper);
  backdrop-filter: blur(10px);
}

.signal-card span,
.post-section,
.post-meta {
  color: inherit;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.signal-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.4rem;
}

.signal-card p {
  margin: 0.25rem 0 0;
  color: #e4ded0;
}

.section-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--ink);
  background: var(--ink);
}

.metrics div {
  min-height: 132px;
  padding: 1.35rem;
  background: var(--paper);
}

.metrics strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 1.1rem;
}

.metrics span,
.post-card p,
.page-hero p,
.content,
.site-footer p {
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.split h2,
.writing-head h2,
.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
}

.focus-grid {
  display: grid;
  gap: 1rem;
}

.focus-grid article {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 1rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}

.focus-grid span {
  color: var(--warm);
  font-family: var(--mono);
  font-weight: 700;
}

.focus-grid h3 {
  margin-bottom: 0.35rem;
  font-size: 1.45rem;
}

.focus-grid p {
  margin: 0;
  color: var(--muted);
}

.writing-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--ink);
}

.writing-head a {
  color: var(--accent-dark);
  font-family: var(--mono);
  font-weight: 700;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 1.2rem;
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.post-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  background: var(--paper);
}

.post-section {
  color: var(--accent);
}

.post-card h3 {
  margin: 0.8rem 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.post-card p {
  margin: 0;
}

.post-meta {
  margin-top: auto;
  padding-top: 1.4rem;
  color: #777168;
}

.page-hero {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 7rem) 0 2rem;
}

.page-hero.compact {
  min-height: 330px;
}

.page-hero p {
  max-width: 660px;
  font-size: 1.08rem;
}

.article-shell {
  width: min(840px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.article-meta {
  margin: 1rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.86rem;
}

.content {
  font-size: 1.06rem;
}

.content h1,
.content h2,
.content h3 {
  margin-top: 2.2rem;
  margin-bottom: 0.8rem;
  line-height: 1.16;
}

.content p,
.content ul,
.content ol {
  margin: 0 0 1.15rem;
}

.content a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.content code {
  padding: 0.15rem 0.32rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f0ece2;
  color: #272521;
  font-family: var(--mono);
  font-size: 0.9em;
}

.content pre {
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171717;
  color: #f8f3e8;
}

.content pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.content img {
  height: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.embed-card {
  display: block;
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.gist-embed {
  overflow: auto;
}

.content .twitter-tweet,
.tweet-embed {
  border-left: 4px solid var(--accent);
}

.tweet-embed strong {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-bottom: 5rem;
}

.tag-list a {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 700;
}

.tag-list span {
  color: var(--muted);
  font-family: var(--mono);
}

.site-footer {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 2rem;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 2.2rem 0 3rem;
  border-top: 1px solid var(--ink);
}

.site-footer p {
  max-width: 520px;
  margin: 0.25rem 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
}

@media (max-width: 920px) {
  .hero,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-panel,
  .hero-panel img {
    min-height: 420px;
  }

  .metrics,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    min-height: 210px;
  }
}

@media (max-width: 760px) {
  .site-header {
    width: 100%;
    padding: 12px 16px;
    background: rgba(247, 245, 239, 0.9);
  }

  .site-nav {
    position: absolute;
    top: 66px;
    right: 16px;
    left: 16px;
    display: none;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-toggle {
    display: block;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 14vw, 4.4rem);
  }

  .hero-panel,
  .hero-panel img {
    min-height: 360px;
  }

  .writing-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}
