/* The blog (/blog, lib/blog.js). Same palette and type as the rest of the site, set for long reading. */
:root {
  --bg: #04060a;
  --fg: #e6eef5;
  --text: rgba(230, 238, 245, 0.86);
  --dim: rgba(230, 238, 245, 0.55);
  --faint: rgba(207, 227, 242, 0.14);
  --line: rgba(207, 227, 242, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 300 1.0625rem/1.75 "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--fg); text-underline-offset: 3px; text-decoration-color: var(--line); }
a:hover { text-decoration-color: var(--fg); }
img, iframe { max-width: 100%; }
img { height: auto; display: block; }

.preview-bar { background: var(--fg); color: var(--bg); text-align: center; font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; padding: 8px; }

/* header + footer */
.top, .foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px max(16px, env(safe-area-inset-left)); max-width: 1120px; width: 100%; margin: 0 auto; }
.mark { font-weight: 200; font-size: 1.35rem; letter-spacing: .5em; text-decoration: none; color: var(--fg); text-transform: lowercase; }
.top nav { display: flex; align-items: center; gap: 22px; }
.top nav a, .back { color: var(--dim); text-decoration: none; font-size: .68rem; letter-spacing: .32em; text-transform: uppercase; }
.top nav a:hover, .back:hover { color: var(--fg); }
.top .nav-cta { color: var(--fg); border: 1px solid var(--line); padding: .6rem .9rem .6rem 1.1rem; }
.top .nav-cta:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.foot { margin-top: auto; border-top: 1px solid var(--faint); padding-top: 28px; padding-bottom: 40px; color: var(--dim); font-size: .85rem; flex-wrap: wrap; }
.foot .mark { font-size: 1rem; }

/* the button used across the blog */
.btn { display: inline-block; color: var(--fg); text-decoration: none; font-weight: 300; font-size: .72rem; letter-spacing: .38em; text-transform: uppercase;
  padding: .95rem 1.6rem .95rem 1.98rem; border: 1px solid var(--line); transition: background .3s ease, color .3s ease, border-color .3s ease; }
.btn:hover, .btn:focus-visible { background: var(--fg); color: var(--bg); border-color: var(--fg); outline: none; }
.score-cta { text-align: center; margin: 2.2em 0; }

/* index */
main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.index h1 { font-weight: 200; font-size: clamp(2.4rem, 7vw, 4rem); letter-spacing: .4em; color: var(--fg); text-transform: lowercase; margin: 24px 0 10px; }
.index .lede { color: var(--dim); margin-bottom: 44px; }
.cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 40px 28px; }
.card a { display: grid; gap: 12px; text-decoration: none; color: inherit; }
.card img, .card .no-cover { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border: 1px solid var(--faint); background: rgba(207, 227, 242, .04); }
.card h2 { font-weight: 400; font-size: 1.2rem; line-height: 1.35; color: var(--fg); }
.card a:hover h2 { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.card p { font-size: .95rem; color: var(--dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.byline { color: var(--dim); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 0 8px; }
.empty { color: var(--dim); padding: 40px 0; }

/* post */
.post article { max-width: 700px; margin: 0 auto; }
.post-head { margin: 20px 0 30px; }
.post-head h1 { font-weight: 300; color: var(--fg); font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.15; letter-spacing: -.01em; margin: 18px 0 16px; }
.post-head .lede { font-size: 1.2rem; color: var(--dim); line-height: 1.55; margin-bottom: 18px; }
.cover { margin: 0 0 36px; }
.cover img { width: 100%; border: 1px solid var(--faint); }

.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-weight: 400; color: var(--fg); font-size: 1.55rem; line-height: 1.3; margin-top: 2em; scroll-margin-top: 20px; }
.prose h3 { font-weight: 400; color: var(--fg); font-size: 1.2rem; margin-top: 1.7em; }
.prose h4, .prose h5, .prose h6 { font-weight: 500; color: var(--fg); margin-top: 1.5em; }
.prose strong { font-weight: 500; color: var(--fg); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { border-left: 2px solid var(--line); padding-left: 1.1em; color: var(--fg); font-style: italic; }
.prose code { font: .9em ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(207, 227, 242, .08); padding: .1em .35em; }
.prose pre { overflow-x: auto; background: rgba(207, 227, 242, .06); padding: 16px; border: 1px solid var(--faint); }
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--faint); margin: 2.4em 0; }
.prose figure { margin: 2em 0; }
.prose figure img { width: 100%; border: 1px solid var(--faint); }
figcaption { color: var(--dim); font-size: .85rem; margin-top: 10px; text-align: center; }
.table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--faint); padding: 10px 12px 10px 0; text-align: left; vertical-align: top; }
.prose th { font-weight: 500; color: var(--fg); }

/* embeds */
.embed { display: grid; justify-items: center; }
.yt button { position: relative; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--faint); background: #000; cursor: pointer; padding: 0; overflow: hidden; }
.yt button img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .3s ease; border: 0; }
.yt button:hover img { opacity: 1; }
.yt .play { position: absolute; inset: 50% auto auto 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); background: rgba(4, 6, 10, .8); border: 1px solid var(--line); border-radius: 12px; }
.yt .play::after { content: ""; position: absolute; inset: 50% auto auto 54%; transform: translate(-50%, -50%); border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent var(--fg); }
.yt iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.linkedin iframe { width: 100%; max-width: 504px; border: 1px solid var(--faint); background: #fff; }
.tweet blockquote { border: 1px solid var(--faint); padding: 16px; font-style: normal; }
.twitter-tweet { margin: 0 auto !important; }

/* FAQ + end of post */
.faq { margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--faint); }
.faq h2 { font-weight: 400; color: var(--fg); font-size: 1.55rem; margin-bottom: .4em; }
.faq h3 { font-weight: 400; color: var(--fg); font-size: 1.1rem; margin-top: 1.4em; }
.faq p { margin-top: .5em; }
.end-cta { margin-top: 3.2em; border: 1px solid var(--faint); padding: 32px 22px 8px; text-align: center; }
.end-cta h2 { font-weight: 300; color: var(--fg); font-size: 1.45rem; }
.end-cta p:not(.score-cta) { color: var(--dim); margin-top: .6em; }
.end-cta .score-cta { margin: 1.6em 0 1.4em; }
.more { margin-top: 80px; }
.more > h2 { font-weight: 300; font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; color: var(--dim); margin-bottom: 24px; }

@media (max-width: 560px) {
  body { font-size: 1.03rem; }
  .top nav { gap: 14px; }
  .top nav a:first-child { display: none; }
  .top .nav-cta { letter-spacing: .22em; padding: .55rem .7rem; }
  .mark { letter-spacing: .4em; }
}

/* [moat-score-calculator]: the Moat Score inside a post */
.prose figure.calc { margin: 2.4em 0; }
/* starts at the first step's measured height (+2px border) so nothing below it moves when it loads; then it follows each step */
.prose figure.calc { scroll-margin-top: 16px; }
.calc iframe { display: block; width: 100%; height: 421px; border: 1px solid var(--faint); background: var(--bg); transition: height .4s ease; }
.calc figcaption { text-align: left; }
.calc summary { cursor: pointer; }
.calc code { display: block; margin-top: 8px; padding: 10px 12px; word-break: break-all; white-space: normal; }
@media (max-width: 560px) { .prose figure.calc { margin-left: -16px; margin-right: -16px; } .calc iframe { border-left: 0; border-right: 0; height: 461px; } .calc figcaption { padding: 0 16px; } }
