:root {
  --primary: #0066cc;
  --primary-focus: #0071e3;
  --primary-on-dark: #2997ff;
  --ink: #1d1d1f;
  --on-dark: #ffffff;
  --body-muted: #cccccc;
  --ink-muted-80: #333333;
  --ink-muted-48: #7a7a7a;
  --hairline: #e0e0e0;
  --hairline-ring: rgba(0, 0, 0, 0.08);
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --parchment-80: rgba(245, 245, 247, 0.8);
  --tile-1: #272729;
  --tile-2: #2a2a2c;
  --black: #000000;
  --card: #ffffff;
  --btn: #0066cc;
  --gnav: #000000;
  --divider-on-tile: rgba(255, 255, 255, 0.12);

  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-pill: 9999px;
  --section: 80px;
  --product-shadow: 3px 5px 30px 0 rgba(0, 0, 0, 0.22);
  --frosted: saturate(180%) blur(20px);
}

/* Dark mode follows the system setting (Apple's dark palette: true black, graphite cards, brighter link blue) */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --primary: #2997ff;
    --primary-focus: #2997ff;
    --btn: #0071e3;
    --ink: #f5f5f7;
    --body-muted: #a1a1a6;
    --ink-muted-80: #d2d2d7;
    --ink-muted-48: #98989d;
    --hairline: #38383a;
    --hairline-ring: rgba(255, 255, 255, 0.1);
    --canvas: #000000;
    --card: #1c1c1e;
    --parchment: #101012;
    --parchment-80: rgba(22, 22, 23, 0.8);
    --tile-1: #1c1c1e;
    --tile-2: #2c2c2e;
    --gnav: #161617;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.374px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 2px; }
.wrap { max-width: 1068px; margin: 0 auto; padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px)); }

/* Global nav */
.gnav { background: var(--gnav); height: 44px; }
.gnav .wrap { height: 100%; display: flex; align-items: center; justify-content: center; gap: 36px; font-size: 12px; letter-spacing: -0.12px; }
.gnav a { color: var(--on-dark); opacity: .88; }
.gnav a:hover { opacity: 1; }
.gnav .gnav__brand { font-weight: 600; opacity: 1; }

/* Frosted sub-nav */
.subnav { position: sticky; top: 0; z-index: 10; background: var(--parchment-80); -webkit-backdrop-filter: var(--frosted); backdrop-filter: var(--frosted); border-bottom: 1px solid var(--hairline-ring); }
.subnav .wrap { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.subnav__title { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: 0.231px; color: var(--ink); }
.subnav__title img { width: 28px; height: 28px; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.subnav__title:hover img { transform: rotate(-8deg) scale(1.08); }
.gnav .gnav__brand { display: inline-flex; align-items: center; gap: 7px; }
.gnav__brand img { width: 16px; height: 16px; }
.subnav__links { display: flex; align-items: center; gap: 20px; font-size: 12px; letter-spacing: -0.12px; }
.subnav__links a:not(.btn) { color: var(--ink); }
.subnav .btn { font-size: 12px; padding: 4px 11px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font: 400 17px/1 var(--font-text); letter-spacing: -0.374px; padding: 11px 22px; border-radius: var(--radius-pill); border: 1px solid transparent; cursor: pointer; transition: transform .12s ease; }
.btn:active { transform: scale(0.95); }
.btn--primary { background: var(--btn); color: var(--on-dark); }
.btn--secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.link-more::after { content: " ›"; }

/* Type */
.hero-display { font-family: var(--font-display); font-size: 56px; font-weight: 600; line-height: 1.07; letter-spacing: -0.28px; margin: 0; text-wrap: balance; }
.display-lg { font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1.1; margin: 0; text-wrap: balance; }
.lead { font-family: var(--font-display); font-size: 28px; font-weight: 400; line-height: 1.14; letter-spacing: 0.196px; margin: 8px 0 0; text-wrap: balance; }
.tagline { font-family: var(--font-display); font-size: 21px; font-weight: 600; line-height: 1.19; letter-spacing: 0.231px; margin: 0 0 12px; }

/* Tiles: edge to edge, the colour change is the divider */
.tile { padding: var(--section) 0; text-align: center; scroll-margin-top: 52px; }
.tile--light { background: var(--canvas); }
.tile--parchment { background: var(--parchment); }
.tile--dark { background: var(--tile-1); color: var(--on-dark); }
.tile--dark .lead { color: var(--body-muted); }
.tile__ctas { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.tile__body { margin-top: 48px; text-align: left; }

.hero { padding: 96px 0 var(--section); }
.hero .tagline { color: var(--primary); }
.brand { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-bottom: 36px; }
.brand__mark { width: 96px; height: 96px; filter: drop-shadow(3px 5px 30px rgba(0, 0, 0, 0.22)); transition: transform .6s cubic-bezier(.2, 1.4, .3, 1); }
.brand__mark:hover { transform: rotate(-8deg) scale(1.06); }
.brand__word { width: 230px; height: auto; overflow: visible; }
.brand__word path { stroke-dasharray: 1 1; stroke-dashoffset: 0; }
.hero__stats { display: flex; justify-content: center; gap: 56px; margin-top: 64px; }
.hero__stats span { font-size: 14px; letter-spacing: -0.224px; color: var(--ink-muted-48); }
.hero__stats b { display: block; font-family: var(--font-display); font-size: 40px; font-weight: 600; line-height: 1.1; color: var(--ink); }

/* Cards */
.posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 340px)); justify-content: center; gap: 20px; }
.card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 24px; color: var(--ink); }
.card__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; letter-spacing: -0.12px; color: var(--ink-muted-48); }
.card__tag { padding: 3px 10px; border-radius: var(--radius-pill); background: var(--parchment); color: var(--ink-muted-80); }
.card__title { margin: 4px 0 0; font-family: var(--font-display); font-size: 24px; font-weight: 600; line-height: 1.17; letter-spacing: 0; }
.card__summary { margin: 0; color: var(--ink-muted-80); }
.card__more { margin-top: auto; padding-top: 12px; color: var(--primary); }

.card { overflow: hidden; }
.card--empty { justify-content: center; align-items: center; text-align: center; min-height: 220px; background: transparent; border-style: dashed; color: var(--ink-muted-48); }
.card--empty .card__summary { color: var(--ink-muted-48); }
.card--empty:hover { transform: none; border-color: var(--hairline); }
.section .tagline { color: var(--ink-muted-48); }
.nav-cats { display: contents; }
.card__cover { margin: -24px -24px 12px; aspect-ratio: 16 / 10; overflow: hidden; background: var(--parchment); }
.card__cover img, .article__cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__cover img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card__cover img { transform: scale(1.04); }
.article__cover { margin: -16px 0 56px; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--parchment); }
.anim .article__cover { --d: .6s; }
.card__cat { font-size: 12px; font-weight: 600; letter-spacing: -0.12px; color: var(--primary); }

/* Downloads */
.downloads { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; }
.download { display: flex; align-items: center; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--divider-on-tile); }
.download:first-child { border-top: 1px solid var(--divider-on-tile); }
.download__icon { width: 48px; height: 56px; border-radius: var(--radius-sm); background: var(--tile-2); display: grid; place-items: end center; padding-bottom: 8px; font: 600 11px var(--font-text); color: var(--primary-on-dark); flex: none; }
.download__body { flex: 1; min-width: 0; }
.download__name { font-weight: 600; }
.download__desc { font-size: 14px; letter-spacing: -0.224px; color: var(--body-muted); }
.download__desc a { color: var(--primary-on-dark); }
.dl-group + .dl-group { margin-top: 48px; }
.dl-group__title { margin: 0 0 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--body-muted); }

/* ---------- Motion ---------- */
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes char-in { to { opacity: 1; transform: none; filter: blur(0); } }

/* Page load: hero pieces rise in one after another */
.anim .intro-item { opacity: 0; transform: translateY(28px); animation: rise 1s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: var(--d, 0s); }
/* Hero brand: icon springs in, wordmark writes itself stroke by stroke, the i's dot pops last */
@keyframes mark-in { from { opacity: 0; transform: scale(.55) rotate(-14deg); } to { opacity: 1; transform: none; } }
@keyframes draw { 0% { stroke-dashoffset: 1; opacity: 0; } 8% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes dot-in { from { transform: scale(0); } to { transform: scale(1); } }
.anim .brand__mark { animation: mark-in 1s cubic-bezier(.2, 1.4, .3, 1) .05s both; }
.anim .brand__word path { animation: draw .8s cubic-bezier(.6, 0, .2, 1) both; animation-delay: calc(.35s + var(--i) * 80ms); }
.anim .brand__dot { transform-box: fill-box; transform-origin: center; animation: dot-in .55s cubic-bezier(.2, 1.8, .3, 1) 1.05s both; }

.anim .hero .tagline { --d: .95s; }
.anim .hero .char { animation-delay: calc(1.05s + var(--i) * 45ms); }
.anim .hero .lead { --d: 1.55s; }
.anim .hero .tile__ctas { --d: 1.7s; }
.anim .hero .hero__stats { --d: 1.85s; }
.anim .article__head .card__meta { --d: .5s; }

/* Headline: each character blurs into focus */
.char { display: inline-block; white-space: pre; }
.word { display: inline-block; white-space: nowrap; }
.anim .char { opacity: 0; transform: translateY(0.45em); filter: blur(10px); animation: char-in .9s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(.15s + var(--i) * 45ms); }

/* Hero drifts back as you scroll past it */
.hero { overflow: hidden; }
.hero .wrap { transform-origin: 50% 0; will-change: transform, opacity; }

/* Scroll reveal */
.anim .reveal { opacity: 0; transform: translateY(48px); transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0s); }
.anim .reveal.in { opacity: 1; transform: none; }


/* Hover */
.card { transition: transform .45s cubic-bezier(.2, .7, .2, 1), border-color .3s ease; }
.card:hover { transform: translateY(-6px); border-color: var(--primary-focus); }
.link-more::after { display: inline-block; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.card:hover .link-more::after { transform: translateX(5px); }
.download__icon { transition: transform .4s cubic-bezier(.2, .7, .2, 1); }
.download:hover .download__icon { transform: translateY(-4px) rotate(-4deg); }


/* Footer */
.footer { background: var(--parchment); color: var(--ink-muted-80); padding: 40px 0 48px; font-size: 12px; letter-spacing: -0.12px; }
.footer__links { display: flex; gap: 20px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--hairline); }
.footer__links a { color: var(--ink-muted-80); }
.footer__links a:hover { text-decoration: underline; }
.footer__legal { color: var(--ink-muted-48); }

/* Article */
.article { max-width: 692px; margin: 0 auto; padding: 64px 0 var(--section); }
.article__head { text-align: center; margin-bottom: 56px; }
.article__head .card__meta { justify-content: center; margin-top: 20px; }
.article__back { font-size: 14px; letter-spacing: -0.224px; }
.article__back::before { content: "‹ "; }
.prose h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.14; margin: 48px 0 16px; }
.prose h3 { font-size: 21px; font-weight: 600; margin: 32px 0 12px; }
.prose p, .prose ul, .prose ol { margin: 0 0 20px; }
.prose li { margin-bottom: 6px; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 40px 0; padding: 0; font-family: var(--font-display); font-size: 28px; line-height: 1.14; font-weight: 600; color: var(--ink); text-align: center; }
.prose blockquote p { margin: 0; }
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--parchment); padding: 2px 6px; border-radius: 5px; }
.prose pre { background: var(--parchment); border-radius: var(--radius-lg); padding: 24px; overflow-x: auto; margin: 0 0 24px; }
.prose pre code { background: none; padding: 0; font-size: 14px; line-height: 1.6; letter-spacing: 0; }
.prose img { max-width: 100%; }
.prose h2 { scroll-margin-top: 76px; }

/* Tables: hairline rows, bold header on a light band; wide tables scroll inside their own box */
.table-wrap { margin: 0 0 28px; overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius-lg); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; letter-spacing: -0.224px; }
.prose th, .prose td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline); }
.prose thead th { background: var(--parchment); font-weight: 600; color: var(--ink); white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 600; color: var(--ink); }
.prose td code { white-space: nowrap; }

/* Code copy */
.prose pre { position: relative; }
.copy-btn { position: absolute; top: 12px; right: 12px; padding: 5px 12px; border-radius: var(--radius-pill); border: 1px solid var(--hairline); background: var(--card); color: var(--ink); font: 400 12px/1.2 var(--font-text); cursor: pointer; opacity: .85; transition: opacity .2s, transform .12s; }
.copy-btn:hover { opacity: 1; }
.copy-btn:active { transform: scale(0.95); }
.copy-btn.done { color: var(--primary); border-color: var(--primary); opacity: 1; }

/* Table of contents: a block above the text on narrow screens, a sticky rail beside it on wide ones */
.article__body { position: relative; }
.toc { margin: 0 0 40px; padding: 20px 24px; border-radius: var(--radius-lg); background: var(--parchment); }
.toc__title { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-muted-48); }
.toc__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; counter-reset: toc; }
.toc__list a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid transparent; color: var(--ink-muted-80); font-size: 14px; line-height: 1.43; letter-spacing: -0.224px; transition: color .2s, border-color .2s; }
.toc__list a:hover { color: var(--primary); }
.toc__list a[aria-current="true"] { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
@media (min-width: 1260px) {
  .toc { position: absolute; top: 0; bottom: 0; left: calc(100% + 56px); width: 220px; margin: 0; padding: 0; background: none; }
  .toc__inner { position: sticky; top: 88px; }
}

/* Download card at the end of an article */
.article__download { margin-top: 56px; padding: 28px 32px; border-radius: var(--radius-lg); background: var(--tile-1); color: var(--on-dark); }
.article__download-title { margin: 0 0 8px; font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.article__download .download { border: 0; padding: 12px 0 0; }

/* Previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 40px; }
.pager__link { display: flex; flex-direction: column; gap: 4px; padding: 20px 24px; border-radius: var(--radius-lg); border: 1px solid var(--hairline); color: var(--ink); transition: border-color .3s, transform .45s cubic-bezier(.2, .7, .2, 1); }
.pager__link:hover { border-color: var(--primary-focus); transform: translateY(-3px); }
.pager__link--next { text-align: right; grid-column: 2; }
.pager__label { font-size: 12px; color: var(--primary); }
.pager__title { font-weight: 600; line-height: 1.3; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager__link--next { grid-column: 1; } }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 40px 0; }
.empty { color: var(--ink-muted-48); text-align: center; }

@media (max-width: 1068px) {
  .hero-display { font-size: 40px; }
}
@media (max-width: 734px) {
  .gnav .wrap { gap: 20px; }
  .subnav__links a:not(.btn) { display: none; }
  .hero-display { font-size: 34px; }
  .display-lg { font-size: 32px; }
  .lead { font-size: 21px; }
  .hero__stats { gap: 32px; }
  .hero__stats b { font-size: 28px; }
  :root { --section: 56px; }
}
@media (max-width: 419px) {
  .hero-display { font-size: 28px; }
  .posts { grid-template-columns: 1fr; }
  .download { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, .anim .intro-item, .anim .reveal, .anim .char { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; transition: none !important; }
}
