/* FILE: blog.css
   Purpose: The blog's pages (landing/blog/*.html): the landing page's tokens, header, buttons and
            footer (landing/landing.html), plus the article's type. Keep the tokens in step with
            landing.html's `:root`.
   Layer: Website (blog) */

:root {
  --bg: #151515;
  --card: #181818;
  --raised: #1d1d1d;
  --fg: #e5e5e5;
  --fg-2: rgba(229, 229, 229, 0.66);
  --fg-3: rgba(229, 229, 229, 0.44);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.13);
  --hover: rgba(255, 255, 255, 0.045);
  --primary: #e5e5e5;
  --primary-fg: #151515;
  --accent: #4181d3;
  --success: #3dbd8a;
  --logo-filter: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fcfcfc;
    --card: #ffffff;
    --raised: #f6f6f6;
    --fg: #1f1f1f;
    --fg-2: rgba(13, 13, 13, 0.64);
    --fg-3: rgba(13, 13, 13, 0.44);
    --line: rgba(13, 13, 13, 0.08);
    --line-2: rgba(13, 13, 13, 0.13);
    --hover: rgba(13, 13, 13, 0.035);
    --primary: #1a1a1a;
    --primary-fg: #ffffff;
    --accent: #0169cc;
    --success: #10a372;
    --logo-filter: invert(1);
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    16px/1.65 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a {
  color: inherit;
  text-decoration: none;
}
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 16px;
}
@media (min-width: 720px) {
  .wrap {
    padding-inline: 32px;
  }
}

/* Header and buttons, as on the landing page */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}
.brand img {
  width: 20px;
  height: 20px;
  filter: var(--logo-filter);
}
.bar nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.bar nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--fg-2);
  font-size: 14px;
}
.bar nav a:hover,
.bar nav a[aria-current] {
  background: var(--hover);
  color: var(--fg);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    transform 150ms cubic-bezier(0.23, 1, 0.32, 1);
}
.button:active {
  transform: scale(0.97);
}
.button.primary {
  background: var(--primary);
  color: var(--primary-fg);
}
.button.primary:hover {
  background: color-mix(in srgb, var(--primary) 88%, var(--bg));
}
.button.small {
  height: 32px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 8px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 56px 40px;
  color: var(--fg-3);
  font-size: 13px;
}

/* Clayzo animations (landing/motion/player.ts) */
.motion {
  width: 100%;
  max-width: var(--motion-w, 640px);
  aspect-ratio: var(--motion-ratio, 640 / 240);
  margin-inline: auto;
}
.motion canvas {
  display: block;
  width: 100%;
  height: 100%;
}
/* What a mount shows until its animation is ready, and instead of it where it can't play (no
   scripts, no WebGL, a page opened from disk): the same numbers, drawn still. player.ts replaces it
   with the canvas. */
.motion {
  container-type: inline-size;
}
/* The player sizes a mount (an inline style) as soon as it runs. Where it never runs, the still
   version sets the height. */
.motion:not([style]) {
  aspect-ratio: auto;
}
.motion:not([style]) .still.flow > div {
  min-height: 110px;
}
.motion:not([style]) .still.bars .row + .row {
  margin-top: 10px;
}
.still {
  height: 100%;
  font-size: 12px;
  line-height: 1.3;
  color: var(--fg-2);
}
.still-title {
  margin-bottom: 10px;
}
.still.bars {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.still .row {
  display: grid;
  grid-template-columns: minmax(0, 60%) 1fr 30px;
  align-items: center;
  gap: 10px;
  color: var(--fg);
}
@container (min-width: 480px) {
  .still .row {
    grid-template-columns: 200px 1fr 30px;
  }
}
.still .row span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.still .row i {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--accent) 60%, transparent) var(--w),
    var(--line) var(--w)
  );
}
.still-title + .row i {
  background: linear-gradient(to right, var(--accent) var(--w), var(--line) var(--w));
}
.still .row b {
  font-weight: 400;
  color: var(--fg-2);
  text-align: right;
}
.still.flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
@container (max-width: 419px) {
  .still.flow {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
.still.flow > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--card);
}
.still.flow b {
  color: var(--fg);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
}
.still.flow b.ok,
.still.flow em {
  color: var(--success);
}
.still.flow em {
  font-style: normal;
  font-size: 11px;
}
.figure {
  margin: 32px 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
@media (max-width: 520px) {
  .figure {
    padding: 16px;
    margin-inline: -4px;
  }
}

/* The article */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding-block: 56px 0;
}
.kicker {
  color: var(--fg-3);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.kicker a:hover {
  color: var(--fg);
}
.article h1 {
  margin: 12px 0 16px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}
.article .deck {
  margin: 0;
  color: var(--fg-2);
  font-size: 18px;
  line-height: 1.55;
}
.article h2 {
  margin: 56px 0 12px;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 600;
}
.article p,
.article li {
  color: var(--fg-2);
}
.article p {
  margin: 0 0 16px;
}
.article strong {
  color: var(--fg);
  font-weight: 600;
}
.article ul {
  margin: 0 0 16px;
  padding-left: 20px;
}
.article li {
  margin-bottom: 8px;
}
.article li::marker {
  color: var(--fg-3);
}
.article a.inline {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
}
.article a.inline:hover {
  text-decoration-color: currentColor;
}
.article table {
  width: 100%;
  margin: 8px 0 24px;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.article td {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.article td:first-child {
  padding-right: 16px;
  color: var(--fg-2);
}
.article td:last-child {
  color: var(--fg);
  text-align: right;
}
.article hr {
  margin: 56px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.cta {
  margin-top: 56px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--raised);
}
.cta h2 {
  margin-top: 0;
}
.cta p:last-child {
  margin-bottom: 0;
}

/* The blog's list of posts */
.posts {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}
.post {
  display: grid;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: border-color 150ms ease;
}
.post:hover {
  border-color: var(--line-2);
}
.post h2 {
  margin: 6px 0 8px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
}
.post p {
  margin: 0;
  color: var(--fg-2);
}

/* Sections rise in as they arrive, once. Only with scripts on (the page marks <html class="js">),
   so nothing stays hidden without them. */
.js .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 500ms cubic-bezier(0.23, 1, 0.32, 1),
    transform 500ms cubic-bezier(0.23, 1, 0.32, 1);
}
.js .reveal.shown {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
