:root {
  color-scheme: light;
  --color-blue: #0066cc;
  --color-blue-focus: #0071e3;
  --color-blue-dark: #2997ff;
  --color-ink: #1d1d1f;
  --color-muted: #6e6e73;
  --color-hairline: #e0e0e0;
  --color-soft: #f5f5f7;
  --color-pearl: #fafafc;
  --color-dark: #272729;
  --color-dark-2: #1f1f21;
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --font-text: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  --content: 980px;
  --wide: 1440px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--color-ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
}

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

a:hover,
a:focus-visible {
  color: var(--color-blue);
}

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

.sr-only,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  z-index: 1000;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 11px 18px;
  clip: auto;
  color: #fff;
  background: var(--color-blue);
  border-radius: 999px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.global-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 max(24px, calc((100vw - var(--wide)) / 2 + 24px));
  color: #fff;
  background: #000;
  font-size: 12px;
}

.brand,
.primary-menu,
.sub-nav-inner,
.sub-nav-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-height: 44px;
}

.brand-mark {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-weight: 600;
}

.brand-name {
  color: rgba(255, 255, 255, 0.82);
}

.primary-menu {
  gap: 22px;
}

.primary-menu a {
  color: rgba(255, 255, 255, 0.74);
}

.primary-menu a:hover,
.primary-menu a:focus-visible,
.primary-menu .is-active {
  color: #fff;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 1px;
  margin: 5px auto;
  background: currentColor;
}

.sub-nav {
  min-height: 52px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(245, 245, 247, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
}

.sub-nav-inner {
  justify-content: space-between;
  max-width: var(--wide);
  min-height: 52px;
  margin: 0 auto;
  padding: 0 24px;
}

.sub-nav-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
}

.sub-nav-actions {
  gap: 18px;
  font-size: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 22px;
  border: 1px solid var(--color-blue);
  border-radius: 999px;
  background: var(--color-blue);
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease;
}

.button:hover,
.button:focus-visible {
  color: #fff;
  background: var(--color-blue-focus);
}

.button:active {
  transform: scale(0.95);
}

.button:focus-visible {
  outline: 2px solid var(--color-blue-focus);
  outline-offset: 3px;
}

.button-secondary {
  background: transparent;
  color: var(--color-blue);
}

.button-secondary:hover,
.button-secondary:focus-visible {
  color: #fff;
}

.button-small {
  min-height: 32px;
  padding: 5px 13px;
  font-size: 14px;
}

.site-main {
  min-height: 60vh;
}

.product-tile {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: min(720px, calc(100vh - 96px));
  padding: 80px 24px;
  text-align: center;
}

.product-tile-light {
  background: #fff;
  color: var(--color-ink);
}

.product-tile-parchment {
  background: var(--color-soft);
  color: var(--color-ink);
}

.product-tile-dark {
  background: var(--color-dark);
  color: #fff;
}

.compact-hero {
  min-height: 360px;
}

.hero-inner,
.single-hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 600;
}

.product-tile-dark .kicker,
.product-tile-dark .post-meta,
.product-tile-dark p {
  color: rgba(255, 255, 255, 0.72);
}

.hero h1,
.single-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: 0;
}

.lead,
.single-hero p {
  max-width: 720px;
  margin: 24px auto 0;
  font-size: clamp(21px, 3vw, 28px);
  line-height: 1.2;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 32px;
}

.post-section {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 80px 24px;
}

.section-heading {
  max-width: var(--content);
  margin: 0 auto 40px;
  text-align: center;
}

.section-heading h2,
.empty-state h2,
.respond h2,
.comments-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.post-card {
  overflow: hidden;
  border: 1px solid var(--color-hairline);
  border-radius: 18px;
  background: #fff;
}

.post-media {
  display: grid;
  min-height: 260px;
  place-items: center;
  background: var(--color-soft);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
}

.post-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.post-card.is-featured .post-media {
  background: var(--color-dark);
  color: #fff;
}

.post-card-body {
  min-width: 0;
  padding: 24px;
  text-align: left;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--color-muted);
  font-size: 14px;
}

.post-card h2,
.post-card h3 {
  margin: 14px 0 12px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: 0;
  max-width: 100%;
}

.post-card h2 a,
.post-card h3 a {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 20px;
  color: #333;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.text-link {
  color: var(--color-blue);
}

.text-link::after {
  content: " >";
}

.pagination {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.pagination ol,
.pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 0;
  margin: 0;
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-flex;
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--color-hairline);
  border-radius: 999px;
  background: #fff;
}

.pagination .current,
.pagination a:hover,
.pagination a:focus-visible {
  border-color: var(--color-blue);
  color: var(--color-blue);
}

.empty-state {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px;
  border-radius: 18px;
  background: var(--color-soft);
  text-align: center;
}

.single-hero {
  min-height: 560px;
}

.single-hero.has-cover {
  color: #fff;
  background: #000;
}

.single-hero.has-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(0, 0, 0, 0.42);
}

.single-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 80px 24px;
}

.content-wrap.has-toc {
  display: grid;
  grid-template-columns: 220px minmax(0, var(--content));
  gap: 48px;
  align-items: start;
  max-width: 1260px;
}

.toc-panel {
  position: sticky;
  top: 120px;
  padding: 18px 0;
  text-align: left;
}

.toc-panel p {
  margin: 0 0 12px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
}

.toc-panel nav {
  display: grid;
  gap: 8px;
}

.toc-panel a {
  display: block;
  overflow: hidden;
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--color-hairline);
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toc-panel a:hover,
.toc-panel a:focus-visible {
  border-left-color: var(--color-blue);
  color: var(--color-blue);
}

.toc-panel .toc-sub {
  padding-left: 24px;
  font-size: 13px;
}

.content-prose {
  font-size: 19px;
}

.content-prose > *:first-child {
  margin-top: 0;
}

.content-prose h2,
.content-prose h3,
.content-prose h4 {
  margin: 2em 0 0.75em;
  font-family: var(--font-display);
  line-height: 1.18;
  letter-spacing: 0;
}

.content-prose h2 {
  font-size: 36px;
}

.content-prose h3 {
  font-size: 28px;
}

.content-prose p,
.content-prose ul,
.content-prose ol,
.content-prose blockquote,
.content-prose pre {
  margin: 0 0 1.35em;
}

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

.content-prose img {
  width: auto;
  margin: 40px auto;
  border-radius: 8px;
}

.content-prose blockquote {
  padding: 8px 0 8px 24px;
  border-left: 3px solid var(--color-blue);
  color: #333;
}

.content-prose :not(pre) > code {
  padding: 0.16em 0.35em;
  border-radius: 5px;
  background: var(--color-soft);
  color: var(--color-ink);
  font-size: 0.86em;
}

.content-prose .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 0;
}

.apple-code {
  overflow: hidden;
  margin: 32px 0 40px;
  border: 1px solid #d2d2d7;
  border-radius: 14px;
  background: #24272e;
}

.apple-code-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.5);
  background: #20242b;
}

.traffic {
  display: flex;
  gap: 9px;
  justify-self: start;
}

.traffic i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.traffic i:nth-child(1) {
  background: #ff5f57;
}

.traffic i:nth-child(2) {
  background: #ffbd2e;
}

.traffic i:nth-child(3) {
  background: #28c840;
}

.code-title {
  justify-self: center;
  color: #aeb4bf;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.copy-code {
  justify-self: end;
  min-height: 28px;
  padding: 4px 11px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #c8cdd6;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.copy-code:hover,
.copy-code:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.content-prose .apple-code pre {
  overflow: auto;
  margin: 0;
  padding: 26px 32px;
  background: transparent;
  color: #e6edf3;
  font-size: 14px;
  line-height: 1.65;
  tab-size: 4;
}

.content-prose .apple-code pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-family: "SFMono-Regular", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: inherit;
  white-space: pre;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
  color: #ff7ab2;
}

.hljs-string,
.hljs-attr,
.hljs-symbol,
.hljs-bullet {
  color: #a8dc76;
}

.hljs-title,
.hljs-section,
.hljs-selector-id,
.hljs-selector-class {
  color: #78c2ff;
}

.hljs-type,
.hljs-class .hljs-title,
.hljs-number,
.hljs-literal {
  color: #ffbd6b;
}

.hljs-comment,
.hljs-quote {
  color: #7f8792;
  font-style: italic;
}

.hljs-variable,
.hljs-template-variable,
.hljs-operator,
.hljs-punctuation {
  color: #d7dae0;
}

.single-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-hairline);
  color: var(--color-muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list a {
  padding: 6px 12px;
  border: 1px solid var(--color-hairline);
  border-radius: 999px;
  color: var(--color-blue);
  font-size: 14px;
}

.comments-area {
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--color-hairline);
}

.comments-heading {
  margin-bottom: 28px;
}

.comment-list,
.comment-children {
  padding: 0;
  margin: 0;
  list-style: none;
}

.comment {
  margin-bottom: 18px;
}

.comment-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--color-hairline);
  border-radius: 18px;
  background: #fff;
}

.comment-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--color-muted);
  font-size: 14px;
}

.comment-meta strong {
  color: var(--color-ink);
}

.comment-owner {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-blue);
  color: #fff;
  font-size: 12px;
}

.comment-content {
  margin-top: 8px;
}

.comment-actions {
  margin-top: 12px;
  font-size: 14px;
}

.comment-actions a {
  color: var(--color-blue);
}

.comment-children {
  margin: 16px 0 0 32px;
}

.respond {
  margin-top: 48px;
  padding: 32px;
  border-radius: 18px;
  background: var(--color-soft);
}

.comment-form {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--color-muted);
  font-size: 14px;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: #fff;
  color: var(--color-ink);
  font: inherit;
}

input {
  min-height: 44px;
  padding: 0 16px;
}

textarea {
  min-height: 160px;
  padding: 14px 16px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--color-blue-focus);
  outline: 2px solid rgba(0, 113, 227, 0.16);
}

.comments-closed {
  color: var(--color-muted);
}

.friend-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 40px;
}

.friend-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--color-hairline);
  border-radius: 18px;
  background: #fff;
}

.friend-card:hover,
.friend-card:focus-visible {
  border-color: rgba(0, 102, 204, 0.42);
}

.friend-initial {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-soft);
  color: var(--color-ink);
  font-weight: 600;
}

.friend-card strong,
.friend-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card small {
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 14px;
}

.site-footer {
  background: var(--color-soft);
  color: #333;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 64px 24px;
}

.footer-inner h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
}

.footer-inner p {
  margin: 0;
}

.footer-inner nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.footer-inner nav a {
  color: #333;
}

.footer-meta {
  grid-column: 1 / -1;
  color: var(--color-muted);
  font-size: 12px;
}

@media (max-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 833px) {
  .global-nav {
    padding: 0 16px;
  }

  .nav-toggle {
    display: block;
  }

  .primary-menu {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 24px 24px;
    background: #000;
  }

  .primary-menu.is-open {
    display: flex;
  }

  .primary-menu a {
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 17px;
  }

  .sub-nav-actions a:not(.button) {
    display: none;
  }

  .post-grid,
  .form-grid,
  .footer-inner,
  .content-wrap.has-toc,
  .friend-links {
    grid-template-columns: 1fr;
  }

  .toc-panel {
    position: static;
    padding: 0 0 24px;
    border-bottom: 1px solid var(--color-hairline);
  }

  .toc-panel nav {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 4px;
  }

  .toc-panel a,
  .toc-panel .toc-sub {
    flex: 0 0 auto;
    max-width: 220px;
    padding: 7px 12px;
    border: 1px solid var(--color-hairline);
    border-radius: 999px;
  }

}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .product-tile,
  .post-section,
  .content-wrap {
    padding: 48px 18px;
  }

  .hero h1,
  .single-hero h1 {
    font-size: 34px;
  }

  .lead,
  .single-hero p {
    font-size: 21px;
  }

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

  .post-card-body,
  .respond {
    padding: 22px;
  }

  .footer-inner nav {
    grid-template-columns: 1fr;
  }

  .comment-card {
    grid-template-columns: 1fr;
  }

  .comment-children {
    margin-left: 16px;
  }
}
