:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #141412;
  --ink-2: #3d3d38;
  --muted: #6f6f68;
  --line: #deded7;
  --line-strong: #c7c7bf;
  --accent: #2f5bea;
  --accent-soft: #edf1ff;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1200px;
  --gutter: 48px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

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

::selection {
  background: rgba(47, 91, 234, 0.18);
}

a {
  color: inherit;
}

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

.wrap {
  width: min(var(--wrap), 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  text-decoration: none;
}

.skip:focus {
  left: 16px;
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 72px;
}

.site-header__brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-header__links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-header__links a {
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

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

.site-header__cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  background: var(--ink);
  color: #fff !important;
  font-size: 13px;
  font-weight: 500;
}

.site-header__cta:hover {
  background: #2b2b26;
  color: #fff !important;
}

.site-menu {
  display: none;
  position: relative;
}

.site-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.site-menu summary::-webkit-details-marker {
  display: none;
}

.site-menu summary::after {
  content: "+";
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.site-menu[open] summary::after {
  content: "−";
}

.site-menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  min-width: 210px;
  padding: 8px 0;
  background: var(--surface);
  border: 1px solid var(--line);
}

.site-menu nav a {
  display: block;
  padding: 10px 16px;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

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

/* Type */
.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.02;
}

.link-underline {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}

.link-underline:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.btn:hover {
  background: #2b2b26;
  border-color: #2b2b26;
  color: #fff;
}

/* Blog index */
.blog-index {
  padding: 88px 0 96px;
}

.blog-index__head {
  max-width: 820px;
}

.blog-index__dek {
  max-width: 62ch;
  margin: 0 0 56px;
  color: var(--ink-2);
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.45;
}

.post-list {
  max-width: 820px;
  margin-inline: auto;
  border-top: 1px solid var(--line);
}

.post-list__item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.post-list__date {
  padding-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-list__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
  transition: color 0.18s var(--ease);
}

.post-list__desc {
  grid-column: 2;
  max-width: 60ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.post-list__item:last-child { border-bottom: 0; }

.post-list__item:hover .post-list__title {
  color: var(--accent);
}

.post-list__empty {
  padding: 28px 0;
  color: var(--muted);
}

/* Post */
.post {
  padding: 80px 0 96px;
}

.post__header-inner {
  max-width: 840px;
}

.post h1 {
  font-size: clamp(38px, 4.8vw, 60px);
}

.post__dek {
  max-width: 60ch;
  margin: 0 0 28px;
  color: var(--ink-2);
  font-size: clamp(18px, 1.5vw, 21px);
  line-height: 1.45;
}

.post__meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post__body {
  max-width: 720px;
  padding-top: 48px;
}

.post__body > * + * {
  margin-top: 1.4em;
}

.post__body p,
.post__body li {
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.75;
}

.post__body h2 {
  margin-top: 2.2em;
  color: var(--ink);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.post__body h3 {
  margin-top: 2em;
  color: var(--ink);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.post__body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.post__body a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.post__body strong {
  color: var(--ink);
  font-weight: 600;
}

.post__body ul,
.post__body ol {
  padding-left: 1.2em;
}

.post__body li + li {
  margin-top: 0.5em;
}

.post__body blockquote {
  margin: 2em 0;
  padding-left: 24px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
  font-size: 20px;
  line-height: 1.5;
}

.post__body code {
  padding: 0.12em 0.35em;
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 0.88em;
}

.post__body pre {
  overflow-x: auto;
  padding: 24px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
}

.post__body pre code {
  padding: 0;
  background: none;
  color: inherit;
}

.post__body hr {
  margin: 3em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.post__footer {
  max-width: 720px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

/* 404 */
.not-found {
  padding: 120px 0 140px;
}

.not-found h1 {
  max-width: 14ch;
}

.not-found__line {
  margin: 0 0 32px;
  color: var(--ink-2);
  font-size: 18px;
}

.not-found__actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Footer */
.site-footer {
  margin-top: 80px;
  padding: 56px 0;
  border-top: 1px solid var(--line);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
}

.site-footer__brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.site-footer__name {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-footer__label {
  margin: 0 0 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer ul a {
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

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

@media (max-width: 1024px) {
  :root {
    --gutter: 32px;
  }
}

@media (max-width: 860px) {
  :root {
    --gutter: 24px;
  }

  .site-header__links {
    display: none;
  }

  .site-menu {
    display: block;
  }

  .site-header__inner {
    min-height: 64px;
  }

  .blog-index {
    padding: 56px 0 72px;
  }

  .post-list__item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .post-list__desc {
    grid-column: 1;
  }

  .post {
    padding: 48px 0 72px;
  }

  .post__body {
    padding-top: 32px;
  }

  .post__body p,
  .post__body li {
    font-size: 17px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .not-found {
    padding: 72px 0 96px;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 20px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .post__body blockquote {
    padding-left: 16px;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Subscribe */
.subscribe { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); max-width: 560px; }
.subscribe__title { font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.subscribe__note { font-size: 14px; line-height: 1.55; color: var(--muted); margin-bottom: 16px; max-width: 46ch; }
.subscribe__form { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.subscribe__input { flex: 1 1 220px; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid #8a8a83; background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.subscribe__input::placeholder { color: var(--muted); }
.subscribe__input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.subscribe__fallback { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.subscribe__sep { color: var(--line-strong); }
.blog-index .subscribe { max-width: 820px; }
.blog-index .subscribe__form { max-width: 560px; }
.post__footer .subscribe { margin-top: 0; padding-top: 0; border-top: 0; max-width: none; }
.post__footer > .link-underline { display: inline-block; margin-top: 28px; }
@media (max-width: 420px) {
  .subscribe__form { flex-direction: column; align-items: stretch; }
  .subscribe .btn { width: 100%; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
