*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--backdrop), var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Safari fills the overscroll gap with the plain background colour, never images, and crops fixed layers there unless they overhang the
   viewport on every side by a lot (150vmax, tested). So with JS the backdrop moves to a fixed layer with a transparent --bleed border whose
   padding box matches the document, kept in step with scrolling by a scroll-driven animation. --doc-h and --scroll-max come from base.html. */
@supports (animation-timeline: scroll()) {
  :root.js { --bleed: 150vmax; }
  .js body { background: var(--bg); }
  .js body::before {
    content: "";
    position: fixed;
    z-index: -1;
    top: calc(-1 * var(--bleed));
    left: calc(-1 * var(--bleed));
    width: calc(100% + 2 * var(--bleed));
    height: calc(var(--doc-h, 100vh) + 2 * var(--bleed));
    border: var(--bleed) solid transparent;
    background: var(--backdrop);
    pointer-events: none;
    animation: backdrop-follow linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes backdrop-follow { to { translate: 0 calc(-1 * var(--scroll-max, 0px)); } }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 {
  font-size: var(--step-1);
  font-family: var(--font-display-small);
  font-weight: var(--heading-small-weight);
  text-transform: var(--heading-small-case);
  letter-spacing: var(--heading-small-tracking);
}

p, ul, ol { margin: 0 0 var(--space-3); }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: var(--line); margin: var(--space-5) 0; }

.skip-link { position: absolute; left: -100vw; }
.skip-link:focus { left: var(--space-3); top: var(--space-3); z-index: 20; background: var(--surface); padding: var(--space-2) var(--space-3); }

.container { width: min(100% - 2 * var(--space-4), var(--page-width)); margin-inline: auto; }
.prose { max-width: var(--measure); }
article.prose { margin-inline: auto; }
.prose h2 { margin-top: var(--space-5); font-size: var(--step-2); }
.muted { color: var(--text-muted); }
.eyebrow { font-family: var(--font-label); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--highlight); margin-bottom: var(--space-2); }
.gradient-text { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.site-header { padding-block: var(--space-4); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.wordmark { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text); text-decoration: none; font-family: var(--font-wordmark); font-weight: var(--wordmark-weight); text-transform: var(--wordmark-case); letter-spacing: var(--wordmark-tracking); font-size: var(--step-1); }
.wordmark svg { width: 2.2em; height: 2.2em; }
.logo-cluster, :root[data-logo="cluster"] .logo-trillion { display: none; }
:root[data-logo="cluster"] .logo-cluster { display: inline; }
.site-header nav { margin-left: auto; }
.nav { display: flex; gap: var(--space-4); list-style: none; margin: 0; padding: 0; position: static; inset: auto; overflow: visible; width: auto; height: auto; border: 0; background: none; color: inherit; }
.menu-button { display: none; padding: var(--space-2); border: var(--line); border-radius: var(--radius); background: none; color: var(--text); cursor: pointer; }
.menu-button svg { display: block; width: 1.25rem; height: 1.25rem; }
.icon-button { padding: var(--space-2); border: 0; background: none; color: var(--text-muted); cursor: pointer; }
.icon-button:hover { color: var(--text); }
.icon-button svg { display: block; width: 1.25rem; height: 1.25rem; }
[data-tooltip] { position: relative; --tooltip-x: -50%; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + var(--space-1)); left: 50%; z-index: 30; translate: var(--tooltip-x) 0.25rem; padding: 0.3em 0.65em; white-space: nowrap; font: 500 var(--step--1) / 1.4 var(--font-sans); letter-spacing: normal; text-transform: none; color: var(--text); background: var(--surface); border: var(--line); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity 120ms ease, translate 120ms ease; }
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; translate: var(--tooltip-x) 0; transition-delay: 400ms; }
.site-header [data-tooltip]::after { bottom: auto; top: calc(100% + var(--space-1)); left: auto; right: 0; --tooltip-x: 0; }
.mode-toggle .dark-half { fill: light-dark(transparent, currentColor); }
.mode-toggle .light-half { fill: light-dark(currentColor, transparent); }
@media (max-width: 40rem) {
  .menu-button { display: block; }
  .nav:not(:popover-open) { display: none; }
  .nav:popover-open { flex-direction: column; gap: var(--space-3); position: fixed; inset: 4.5rem var(--space-4) auto auto; padding: var(--space-3) var(--space-5) var(--space-3) var(--space-4); background: var(--surface); border: var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
}
.nav a { color: var(--text-muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }

main { flex: 1; padding-block: var(--space-5) var(--space-7); }

.hero { padding-block: var(--space-6); display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: var(--space-5); }
.hero-crystal { justify-self: center; padding: 3rem; }
.hero-crystal svg { display: block; width: clamp(12rem, 22vw, 20rem); height: auto; }
@media (max-width: 60rem) { .hero { grid-template-columns: 1fr; } .hero-crystal { display: none; } }
.hero h1 { margin-bottom: var(--space-2); }
.hero .subtitle { font-family: var(--font-display); font-weight: var(--heading-weight); letter-spacing: var(--heading-tracking); font-size: var(--step-2); margin-bottom: var(--space-4); }
.hero .lead { font-size: var(--step-1); color: var(--text-muted); max-width: 44ch; margin-bottom: var(--space-5); }
.not-found { display: grid; justify-items: center; text-align: center; padding-block: var(--space-7); }
.not-found svg { width: clamp(7rem, 14vw, 10rem); height: auto; margin-bottom: var(--space-4); }
.not-found .logo-trillion path[d^="M23.26"] { fill: none !important; stroke: var(--text-muted); stroke-width: 0.3; stroke-dasharray: 0.8 0.6; stroke-opacity: 0.5; }
.not-found .lead { font-size: var(--step-1); color: var(--text-muted); margin-bottom: var(--space-5); }
.not-found .button-row { justify-content: center; }

.post-list { list-style: none; padding: 0; margin: var(--space-5) 0 0; max-width: var(--measure); display: grid; gap: var(--space-5); }
.post-list h2 { font-size: var(--step-2); margin-bottom: var(--space-2); }
.post-list h2 a { color: var(--text); text-decoration: none; }
.post-list h2 a:hover { color: var(--accent); text-decoration: underline; }
.post-list time { display: block; }
.post-list p { margin: 0; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-4); max-width: var(--measure); margin-top: var(--space-6); padding-top: var(--space-4); border-top: var(--line); }
.pagination a { margin: 0; text-decoration: none; }
.pagination a:hover { color: var(--accent); }
.pagination .newer { grid-column: 1; justify-self: start; }
.pagination .position { grid-column: 2; font-size: var(--step--1); }
.pagination .older { grid-column: 3; justify-self: end; }
.tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-4); }
.tag-list .badge { margin: 0; text-decoration: none; }
.tag-list .badge:hover { text-decoration: underline; }
.card time { display: block; }
pre.giallo { color-scheme: inherit !important; background-color: var(--surface) !important; }
.giallo-l { display: inline-block; min-height: 1lh; width: 100%; }
.giallo-ln { display: inline-block; user-select: none; margin-right: 0.4em; padding: 0.4em; min-width: 3ch; text-align: right; opacity: 0.8; }
.post-nav { display: grid; gap: var(--space-5); margin-top: var(--space-6); padding-top: var(--space-4); border-top: var(--line); }
.post-nav-adjacent { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.post-nav-adjacent:empty { display: none; }
.post-nav-link { display: grid; gap: var(--space-1); align-content: start; color: var(--text); text-decoration: none; font-family: var(--font-display); font-size: var(--step-1); line-height: 1.3; }
.post-nav-link .eyebrow { margin: 0; }
.post-nav-link:hover { color: var(--accent); }
.post-nav-link.older { grid-column: 2; text-align: right; }
.post-nav .button-row { justify-content: center; }
.blog-header { margin-bottom: var(--space-5); }
.blog-layout { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(12rem, 16rem); justify-content: space-between; gap: var(--space-6); align-items: start; }
.blog-layout .post-list { margin-top: 0; }
.post-list .tag-list { margin: var(--space-2) 0 0; }
.blog-filters { display: none; }
.js .blog-filters { display: grid; gap: var(--space-4); position: sticky; top: var(--space-4); }
.filter-panel { display: grid; gap: var(--space-4); }
.blog-header .filters-toggle { display: none; }
@media (max-width: 60rem) {
  .blog-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .js .blog-filters { order: -1; position: static; }
  .js .blog-header .filters-toggle { display: inline-block; }
  .js:has(.filters-toggle[aria-expanded="false"]) .blog-filters { display: none; }
}
.post-search { width: 100%; font: inherit; font-size: var(--step--1); padding: 0.5em 0.75em; color: var(--text); background: var(--surface); border: var(--line); border-radius: var(--radius); }
.post-search::placeholder { color: var(--text-muted); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.filter-group:has(.chips > :only-child) { display: none; }
.chip { font: inherit; font-family: var(--font-label); font-size: var(--step--1); line-height: 1.4; padding: 0.15em 0.6em; color: var(--text-muted); background: none; border: var(--line); border-radius: var(--radius); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip[aria-pressed="true"] { color: var(--highlight); background: color-mix(in oklab, var(--highlight) 16%, transparent); border-color: color-mix(in oklab, var(--highlight) 60%, transparent); }
.filter-status { margin: 0; font-size: var(--step--1); }
.filter-status:empty { display: none; }
.clear-filters { justify-self: start; font: inherit; font-size: var(--step--1); color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
[data-filtering] #post-list, [data-filtering] #pagination, [data-filtering] #no-posts { visibility: hidden; }
button.button { font-family: inherit; font-size: inherit; border: 0; cursor: pointer; }
.subscribe { anchor-name: --subscribe; }
.subscribe svg { width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin-right: 0.45em; }
.subscribe-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.subscribe-group .badge { margin: 0; }
.subscribe-group .subscribe-label { margin: 0; }
.subscribe-menu { position-anchor: --subscribe; inset: auto; margin: var(--space-2) 0 0; position-area: bottom span-right; position-try-fallbacks: flip-inline, flip-block; min-width: 15rem; padding: var(--space-3) var(--space-4); color: var(--text); background: var(--surface); border: var(--line); box-shadow: var(--shadow); font-size: var(--step-0); }
@supports not (position-area: bottom) { .subscribe-menu { inset: 0; margin: auto; } }
.subscribe-label { font-family: var(--font-label); font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin: 0 0 var(--space-1); }
.feed-links { display: flex; gap: var(--space-3); list-style: none; padding: 0; margin: 0; }
.subscribe-hint { font-size: var(--step--1); margin: 0; }

.section { margin-top: var(--space-7); }
.section > h2 { margin-bottom: var(--space-4); }

.button-row { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.button {
  --frame-plain: color-mix(in oklab, var(--accent) 78%, transparent);
  --frame-colour: var(--frame-plain);
  --s0: polygon(0.8372em 0, calc(100% - 0.8372em) 0, 100% 50%, calc(100% - 0.8372em) 100%, 0.8372em 100%, 0 50%);
  --frame: polygon(0.8372em 0, calc(100% - 0.8372em) 0, 100% 50%, calc(100% - 0.8372em) 100%, 0.8372em 100%, 0 50%, 0.8372em 0, 1.155px 50%, calc(0.8372em + 0.577px) calc(100% - 1.0px), calc(100% - 0.8372em - 0.577px) calc(100% - 1.0px), calc(100% - 1.155px) 50%, calc(100% - 0.8372em - 0.577px) 1.0px, calc(0.8372em + 0.577px) 1.0px, 1.155px 50%, 0.8372em 0, calc(100.0% - 3.5px) calc(50% - 6.062px), 100% 50%, calc(100.0% - 3.5px) calc(50% + 6.062px), calc(100.0% - 5.81px) calc(50% + 6.062px), calc(100% - 2.309px) 50%, calc(100.0% - 5.81px) calc(50% - 6.062px), calc(100.0% - 3.5px) calc(50% - 6.062px), 0.8372em 0, 3.5px calc(50% + 6.062px), 0 50%, 3.5px calc(50% - 6.062px), 5.81px calc(50% - 6.062px), 2.309px 50%, 5.81px calc(50% + 6.062px), 3.5px calc(50% + 6.062px), 0.8372em 0);
  --frame-pressed: polygon(calc(0.8372em + 1.155px) 2.0px, calc(100% - 0.8372em - 1.155px) 2.0px, calc(100% - 2.309px) 50%, calc(100% - 0.8372em - 1.155px) calc(100% - 2.0px), calc(0.8372em + 1.155px) calc(100% - 2.0px), 2.309px 50%, calc(0.8372em + 1.155px) 2.0px, 3.464px 50%, calc(0.8372em + 1.732px) calc(100% - 3.0px), calc(100% - 0.8372em - 1.732px) calc(100% - 3.0px), calc(100% - 3.464px) 50%, calc(100% - 0.8372em - 1.732px) 3.0px, calc(0.8372em + 1.732px) 3.0px, 3.464px 50%, calc(0.8372em + 1.155px) 2.0px, calc(100.0% - 5.81px) calc(50% - 6.062px), calc(100% - 2.309px) 50%, calc(100.0% - 5.81px) calc(50% + 6.062px), calc(100.0% - 8.119px) calc(50% + 6.062px), calc(100% - 4.619px) 50%, calc(100.0% - 8.119px) calc(50% - 6.062px), calc(100.0% - 5.81px) calc(50% - 6.062px), calc(0.8372em + 1.155px) 2.0px, 5.81px calc(50% + 6.062px), 2.309px 50%, 5.81px calc(50% - 6.062px), 8.119px calc(50% - 6.062px), 4.619px 50%, 8.119px calc(50% + 6.062px), 5.81px calc(50% + 6.062px), calc(0.8372em + 1.155px) 2.0px);
  --frame-focus: polygon(0.8372em 0, calc(100% - 0.8372em) 0, 100% 50%, calc(100% - 0.8372em) 100%, 0.8372em 100%, 0 50%, 0.8372em 0, 2.309px 50%, calc(0.8372em + 1.155px) calc(100% - 2.0px), calc(100% - 0.8372em - 1.155px) calc(100% - 2.0px), calc(100% - 2.309px) 50%, calc(100% - 0.8372em - 1.155px) 2.0px, calc(0.8372em + 1.155px) 2.0px, 2.309px 50%, 0.8372em 0, calc(100.0% - 3.5px) calc(50% - 6.062px), 100% 50%, calc(100.0% - 3.5px) calc(50% + 6.062px), calc(100.0% - 5.81px) calc(50% + 6.062px), calc(100% - 2.309px) 50%, calc(100.0% - 5.81px) calc(50% - 6.062px), calc(100.0% - 3.5px) calc(50% - 6.062px), 0.8372em 0, 3.5px calc(50% + 6.062px), 0 50%, 3.5px calc(50% - 6.062px), 5.81px calc(50% - 6.062px), 2.309px 50%, 5.81px calc(50% + 6.062px), 3.5px calc(50% + 6.062px), 0.8372em 0);
  --ring4: polygon(evenodd, calc(0.8372em + 2.31px) 4.0px, calc(100% - 0.8372em - 2.31px) 4.0px, calc(100% - 4.619px) 50%, calc(100% - 0.8372em - 2.31px) calc(100% - 4.0px), calc(0.8372em + 2.31px) calc(100% - 4.0px), 4.619px 50%, calc(0.8372em + 2.31px) 4.0px, calc(0.8372em + 2.887px) 5.0px, calc(100% - 0.8372em - 2.887px) 5.0px, calc(100% - 5.774px) 50%, calc(100% - 0.8372em - 2.887px) calc(100% - 5.0px), calc(0.8372em + 2.887px) calc(100% - 5.0px), 5.774px 50%, calc(0.8372em + 2.887px) 5.0px);
  --corners: linear-gradient(var(--accent-2), var(--accent-2)) right 0 center / 50% 12.124px no-repeat, linear-gradient(var(--accent-2), var(--accent-2)) left 0 center / 50% 12.124px no-repeat;
  position: relative;
  isolation: isolate;
  display: inline-block;
  padding: 0.7em 2.1em;
  line-height: 1.5;
  color: color-mix(in oklab, var(--accent-2) 70%, var(--text));
  font-weight: 600;
  text-decoration: none;
  clip-path: var(--s0);
  background: radial-gradient(ellipse 72% 92% at 50% 130%, color-mix(in oklab, var(--accent) 48%, transparent), transparent), var(--surface);
}
.button.notch {
  --s0: polygon(1.35em 0, 100% 0, 100% calc(100% - 1.35em), calc(100% - 1.35em) 100%, 0 100%, 0 1.35em);
  --frame: polygon(1.35em 0, 100% 0, 100% calc(100% - 1.35em), calc(100% - 1.35em) 100%, 0 100%, 0 1.35em, 1.35em 0, 1.0px calc(1.35em + 0.414px), 1.0px calc(100% - 1.0px), calc(100% - 1.35em - 0.414px) calc(100% - 1.0px), calc(100% - 1.0px) calc(100% - 1.35em - 0.414px), calc(100% - 1.0px) 1.0px, calc(1.35em + 0.414px) 1.0px, 1.0px calc(1.35em + 0.414px), 1.35em 0);
  --frame-pressed: polygon(calc(1.35em + 0.828px) 2.0px, calc(100% - 2.0px) 2.0px, calc(100% - 2.0px) calc(100% - 1.35em - 0.828px), calc(100% - 1.35em - 0.828px) calc(100% - 2.0px), 2.0px calc(100% - 2.0px), 2.0px calc(1.35em + 0.828px), calc(1.35em + 0.828px) 2.0px, 3.0px calc(1.35em + 1.243px), 3.0px calc(100% - 3.0px), calc(100% - 1.35em - 1.243px) calc(100% - 3.0px), calc(100% - 3.0px) calc(100% - 1.35em - 1.243px), calc(100% - 3.0px) 3.0px, calc(1.35em + 1.243px) 3.0px, 3.0px calc(1.35em + 1.243px), calc(1.35em + 0.828px) 2.0px);
  --frame-focus: polygon(1.35em 0, 100% 0, 100% calc(100% - 1.35em), calc(100% - 1.35em) 100%, 0 100%, 0 1.35em, 1.35em 0, 2.0px calc(1.35em + 0.828px), 2.0px calc(100% - 2.0px), calc(100% - 1.35em - 0.828px) calc(100% - 2.0px), calc(100% - 2.0px) calc(100% - 1.35em - 0.828px), calc(100% - 2.0px) 2.0px, calc(1.35em + 0.828px) 2.0px, 2.0px calc(1.35em + 0.828px), 1.35em 0);
  --ring4: polygon(evenodd, calc(1.35em + 1.657px) 4.0px, calc(100% - 4.0px) 4.0px, calc(100% - 4.0px) calc(100% - 1.35em - 1.657px), calc(100% - 1.35em - 1.657px) calc(100% - 4.0px), 4.0px calc(100% - 4.0px), 4.0px calc(1.35em + 1.657px), calc(1.35em + 1.657px) 4.0px, calc(1.35em + 2.071px) 5.0px, calc(100% - 5.0px) 5.0px, calc(100% - 5.0px) calc(100% - 1.35em - 2.071px), calc(100% - 1.35em - 2.071px) calc(100% - 5.0px), 5.0px calc(100% - 5.0px), 5.0px calc(1.35em + 2.071px), calc(1.35em + 2.071px) 5.0px);
  --corners: linear-gradient(transparent, transparent);
  padding-inline: 2em;
}
.button.small { font-size: var(--step--1); padding-inline: 1.8em; }
.button::before, .button::after { content: ""; position: absolute; inset: 0; z-index: -1; }
.button::before { clip-path: var(--frame); background: var(--corners), var(--frame-colour); transition: clip-path 90ms ease; }
.button::after { clip-path: var(--ring4); background: linear-gradient(100deg, var(--accent-2), var(--accent) 60%); }
.button:hover { color: var(--text); background: linear-gradient(color-mix(in oklab, var(--accent) 8%, transparent), color-mix(in oklab, var(--accent) 8%, transparent)), radial-gradient(ellipse 72% 92% at 50% 130%, color-mix(in oklab, var(--accent) 48%, transparent), transparent), var(--surface); }
.button:active::before { clip-path: var(--frame-pressed); }
.button:focus-visible { outline: none; }
.button:focus-visible::before { --frame-colour: var(--accent-2); clip-path: var(--frame-focus); }
.button.secondary { --frame-plain: color-mix(in oklab, var(--accent) 25%, color-mix(in oklab, var(--neutral) 16%, transparent)); color: light-dark(var(--text-muted), color-mix(in oklab, var(--accent) 30%, var(--text-muted))); background: none; }
.button.secondary::after { background: color-mix(in oklab, color-mix(in oklab, var(--accent) 50%, var(--neutral)) 55%, transparent); }
.button.secondary:hover { color: var(--text); background: color-mix(in oklab, var(--neutral) 6%, transparent); }
.button.tinted {
  --tint-start: light-dark(oklab(58% -0.05 -0.19), var(--highlight));
  --tint-mid: light-dark(oklab(52% 0.12 -0.19), var(--accent));
  --tint-end: light-dark(oklab(60% 0.2 0.04), var(--highlight-2, var(--highlight)));
  --frame-colour: linear-gradient(100deg, light-dark(var(--tint-start), var(--frame-plain)), light-dark(var(--tint-mid), var(--frame-plain)), light-dark(var(--tint-end), var(--frame-plain)));
}
.button.tinted::after { background: linear-gradient(100deg, var(--tint-start), light-dark(var(--tint-mid), var(--accent-2)) 35%, var(--tint-mid) 65%, var(--tint-end)); }
.button.secondary.tinted { --frame-colour: linear-gradient(100deg, light-dark(color-mix(in oklab, var(--tint-start) 45%, transparent), var(--frame-plain)), light-dark(color-mix(in oklab, var(--tint-mid) 35%, transparent), var(--frame-plain)), light-dark(color-mix(in oklab, var(--tint-end) 45%, transparent), var(--frame-plain))); }
.button.secondary.tinted::after { background: linear-gradient(100deg, color-mix(in oklab, var(--tint-start) 65%, transparent), color-mix(in oklab, var(--tint-mid) 50%, transparent) 50%, color-mix(in oklab, var(--tint-end) 65%, transparent)); }

.grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
@media (max-width: 71.5rem) { .latest-posts > :nth-child(3) { display: none; } .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, max(16rem, 34%)), 1fr)); } }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  background: var(--surface);
  border: var(--card-border);
  border-image: var(--card-border-image);
  border-radius: var(--radius);
  outline: var(--card-outline);
  outline-offset: var(--card-outline-offset);
  box-shadow: var(--card-shadow);
}
.card::before { content: ""; position: absolute; inset: var(--card-ornament-inset); z-index: 1; pointer-events: none; background: var(--card-ornament); }
.card h3 { margin-bottom: var(--space-2); }
.card p:last-child { margin-bottom: 0; }
.card a.stretched::after { content: ""; position: absolute; inset: 0; }
.card a.stretched { text-decoration: none; text-underline-offset: 0.25em; }
.card:has(a.stretched):hover a.stretched { text-decoration: underline; text-decoration-thickness: 2px; }
.card .card-image { margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) var(--space-4); border-bottom: var(--line); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 40 / 21; }
.card .card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-plate { display: grid; place-items: center; background: var(--plate-bg); color: color-mix(in oklab, var(--accent) 70%, transparent); font-family: var(--font-display); font-size: 7rem; line-height: 1; }

.badge { display: inline-block; align-self: flex-start; padding: 0.15em 0.6em; margin-bottom: var(--space-3); border-radius: var(--radius); background: color-mix(in oklab, var(--highlight) 16%, transparent); color: var(--highlight); font-family: var(--font-label); font-size: var(--step--1); }

.figure { margin: var(--space-4) 0; border: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

.details { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-4); }
.details dt { color: var(--text-muted); }
.details dd { margin: 0; }

.tiers { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin: var(--space-4) 0 var(--space-5); }
.tier { color: var(--accent); letter-spacing: 0.15em; font-size: var(--step-1); line-height: 1; margin-bottom: var(--space-2); }
.tier .off { color: var(--border); }
pre { margin: 0 0 var(--space-4); padding: var(--space-3) var(--space-4); overflow-x: auto; background: var(--surface); border: var(--line); border-radius: var(--radius); font-size: var(--step--1); line-height: 1.6; }
code { font-family: var(--font-mono); }
.footnote-reference { line-height: 0; margin-left: 0.1em; }
.footnote-reference a { font-size: 0; text-decoration: none; }
.footnote-reference a::after { counter-increment: footnote; content: counter(footnote); font-size: 0.65rem; }
.footnotes { margin-top: var(--space-5); padding-top: var(--space-3); border-top: var(--line); font-size: var(--step--1); color: var(--text-muted); }
.callout { padding: var(--space-3) var(--space-4); border-left: 3px solid var(--highlight); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; }

.site-footer { border-top: var(--line); padding-block: var(--space-4); font-size: var(--step--1); color: var(--text-muted); }
.site-footer .container { display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--text-muted); }
.footer-controls .icon-button { margin-block: calc(-1 * var(--space-2)); }
.footer-controls { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.site-footer select { font: inherit; color: var(--text); background: var(--surface); border: var(--line); border-radius: var(--radius); padding: 0.2em 0.4em; }

.swatches { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.swatch { border: var(--line); border-radius: var(--radius); overflow: hidden; font-family: var(--font-mono); font-size: var(--step--1); }
.swatch span { display: block; height: 4rem; border-bottom: var(--line); }
.swatch code { display: block; padding: var(--space-2); }

::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: facet-reveal 550ms ease-in-out; }
@keyframes facet-reveal {
  from { clip-path: polygon(var(--reveal-x) var(--reveal-y), var(--reveal-x) var(--reveal-y), var(--reveal-x) var(--reveal-y), var(--reveal-x) var(--reveal-y), var(--reveal-x) var(--reveal-y), var(--reveal-x) var(--reveal-y)); }
  to { clip-path: polygon(calc(var(--reveal-x) - 150vmax) var(--reveal-y), calc(var(--reveal-x) - 75vmax) calc(var(--reveal-y) - 130vmax), calc(var(--reveal-x) + 75vmax) calc(var(--reveal-y) - 130vmax), calc(var(--reveal-x) + 150vmax) var(--reveal-y), calc(var(--reveal-x) + 75vmax) calc(var(--reveal-y) + 130vmax), calc(var(--reveal-x) - 75vmax) calc(var(--reveal-y) + 130vmax)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
