/*
 * Design tokens. Every reused or themeable value lives here; components and
 * page styles only reference these variables. Names follow Basecoat/shadcn
 * so the vendored components work unchanged.
 */
:root {
  /* Colors: see the per-theme blocks below. */
  --card-foreground: var(--foreground);

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.625rem;
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;

  /* Shape */
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-full: 9999px;
  --focus-ring: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);

  /* Layout */
  /* Header, page and footer all share this width: 61rem of content (the home
     page's text and photo side by side) plus .container's padding. */
  --content-width: 63rem;
  --narrow-width: 40rem;
  --header-height: 3.5rem;
  --control-height: 2.25rem;
  --control-height-sm: 2rem;

  /* Motion */
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --theme-transition: 500ms ease-in-out;
}

/*
 * Theme colors, picked by <html data-theme>: light by default (see
 * pages/_layout.html), or the reader's saved choice (client/site.js).
 * (Plain values per theme rather than light-dark(), so a theme change
 * transitions smoothly.)
 */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 12%);
  --button-border: oklch(1 0 0 / 35%);
  --ring: oklch(0.556 0 0);
  --link: oklch(0.75 0.12 260);
  --input-background: oklch(0.235 0 0);
  --input-shadow: 0 1px 2px oklch(0 0 0 / 0.45);
  --switch-track: color-mix(in oklab, oklch(1 0 0 / 15%) 80%, transparent);
  --switch-thumb: var(--foreground);
  --switch-thumb-checked: var(--primary-foreground);
  --theme-thumb: oklch(0.3 0.03 265);
  /* Accents: green (the wordmark) and brown (the current page in the navbar). */
  --brand: oklch(0.74 0.14 145);
  --brand-accent: oklch(0.66 0.08 60);
}

/* Light: sand. Fields are raised white panels with a soft shadow; in dark mode they're solid, lighter boxes. */
:root[data-theme="light"] {
  color-scheme: light;
  --background: oklch(0.93 0.035 80); /* #f4e6ce */
  --foreground: oklch(0.14 0.008 60);
  --card: oklch(1 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.89 0.035 80);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.89 0.035 80);
  --muted-foreground: oklch(0.42 0.015 60);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.84 0.03 80);
  --input: oklch(0.82 0.03 80);
  --button-border: var(--border);
  --ring: oklch(0.5 0.03 60);
  --link: oklch(0.45 0.18 260);
  --input-background: oklch(1 0 0);
  --input-shadow: 0 1px 2px oklch(0.35 0.05 60 / 0.12), 0 2px 8px -2px oklch(0.35 0.05 60 / 0.12);
  --switch-track: oklch(0.85 0.03 80);
  --switch-thumb: var(--background);
  --switch-thumb-checked: var(--background);
  --theme-thumb: oklch(1 0 0);
  --brand: oklch(0.47 0.12 145);
  --brand-accent: oklch(0.5 0.08 55);
}

/* Reset and element defaults. */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  border: 0 solid var(--border);
}

html {
  -webkit-text-size-adjust: 100%;
  /* Reserve the scrollbar so pages of different heights don't shift sideways. */
  scrollbar-gutter: stable;
}

/* Cross-document view transitions: page-to-page navigation cross-fades in place. */
@view-transition {
  navigation: auto;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
}

/* Thin "antialiased" smoothing suits light text on dark; dark text on a light
   page reads fuller with the platform default. */
:root[data-theme="light"] body {
  -webkit-font-smoothing: auto;
}

h1,
h2,
h3 {
  line-height: var(--leading-tight);
  font-weight: var(--weight-semibold);
  text-wrap: balance;
}
h1 {
  font-size: var(--text-2xl);
}
h2 {
  font-size: var(--text-xl);
}
h3 {
  font-size: var(--text-base);
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

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

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Basecoat: button (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding-inline: calc(var(--space-2) * 1.25);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background-clip: padding-box;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  outline: none;
  transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn:focus-visible {
  border-color: var(--ring);
  box-shadow: var(--focus-ring);
}
.btn:active:not([aria-haspopup]) {
  translate: 0 1px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}
@media (hover: hover) {
  .btn:hover {
    background-color: color-mix(in oklab, var(--primary) 80%, transparent);
  }
}
.btn[data-size="sm"] {
  height: var(--control-height-sm);
  gap: var(--space-1);
  padding-inline: var(--space-3);
  border-radius: min(var(--radius-md), 10px);
  font-size: var(--text-sm);
}
.btn[data-variant="secondary"] {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}
.btn[data-variant="outline"] {
  border-color: var(--border);
  background-color: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}
.btn[data-variant="ghost"] {
  background-color: transparent;
  color: var(--foreground);
}
@media (hover: hover) {
  .btn[data-variant="secondary"]:hover {
    background-color: color-mix(in oklch, var(--secondary), var(--foreground) 5%);
  }
  .btn[data-variant="outline"]:hover,
  .btn[data-variant="ghost"]:hover {
    background-color: var(--muted);
  }
  .btn[data-variant="destructive"]:hover {
    background-color: color-mix(in oklab, var(--destructive) 20%, transparent);
  }
}
.btn[data-variant="destructive"] {
  background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--destructive);
}

/* Basecoat: card (MIT, Ronan Berder). Ported from Tailwind to plain CSS. */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-block: var(--space-6);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background-color: var(--card);
  color: var(--card-foreground);
  font-size: var(--text-sm);
}
.card > header {
  display: grid;
  grid-auto-rows: min-content;
  align-items: flex-start;
  gap: var(--space-1);
  padding-inline: var(--space-6);
}
.card > header > :is(h2, h3) {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--leading-normal);
}
.card > header > p {
  color: var(--muted-foreground);
}
.card > section {
  padding-inline: var(--space-6);
}
.card > footer {
  display: flex;
  align-items: center;
  padding-inline: var(--space-6);
}

/* Basecoat: switch (MIT, Ronan Berder). Ported from Tailwind to plain CSS.
   Markup: <input type="checkbox" role="switch" class="switch"> */
.switch[role="switch"] {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  width: 32px;
  height: 18.4px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background-color: var(--switch-track);
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: background-color var(--transition), box-shadow var(--transition);
}
.switch[role="switch"]:checked {
  background-color: var(--primary);
}
.switch[role="switch"]:focus-visible {
  border-color: var(--ring);
  box-shadow: var(--focus-ring);
}
.switch[role="switch"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.switch[role="switch"]::before {
  content: "";
  display: block;
  width: 1rem;
  height: 1rem;
  border-radius: var(--radius-full);
  background-color: var(--switch-thumb);
  pointer-events: none;
  transition: translate var(--transition);
}
.switch[role="switch"]:checked::before {
  translate: calc(100% - 2px) 0;
  background-color: var(--switch-thumb-checked);
}

/* Site layout and page styles. */

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-4);
  z-index: 10;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: var(--text-sm);
  translate: 0 -200%;
}
.skip-link:focus {
  translate: 0 0;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  view-transition-name: site-header;
}
.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-6);
  min-height: var(--header-height);
  padding-block: var(--space-2);
}
.brand {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.brand a {
  color: var(--brand);
  text-decoration: none;
}
.site-nav {
  flex: 1;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}
.nav-links a {
  color: var(--muted-foreground);
  text-decoration: none;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45em;
}
.nav-links a:hover,
.nav-links a[aria-current] {
  color: var(--foreground);
}
.nav-links a[aria-current="page"] {
  text-decoration-line: underline;
  text-decoration-color: var(--brand-accent);
}
/* On narrow screens the brand and theme switch share the first line and the
   links get their own. */
@media (max-width: 48rem) {
  .site-nav {
    order: 1;
    flex-basis: 100%;
  }
  .theme-toggle {
    margin-inline-start: auto;
  }
}

/* Theme switch (the same switch as hypermediajobs.com). */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
/* Switching themes sweeps the new theme across the page from the switch (see
   site.setTheme), rather than fading every color: text and background fading in
   opposite directions pass through the same gray, and the text vanishes. The
   header joins the page snapshot so it's swept with everything else. */
:root.theme-changing::view-transition-old(root),
:root.theme-changing::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
.theme-changing .site-header {
  view-transition-name: none;
}
/* The thumb shows a moon in dark mode and a sun in light mode, and spins once
   while the theme changes. Its look follows <html data-theme> rather than
   :checked, so a saved light theme shows correctly from the first paint. */
.theme-toggle .switch[role="switch"] {
  width: 40px;
  height: 22px;
  padding-inline: 1px;
  background-color: var(--primary);
}
.theme-toggle .switch[role="switch"]::before {
  content: "\1F319";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 1;
  background-color: var(--theme-thumb);
  box-shadow: var(--shadow-xs);
  translate: 18px 0;
  transition: translate var(--theme-transition), background-color var(--theme-transition);
}
:root[data-theme="light"] .theme-toggle .switch[role="switch"] {
  background-color: var(--switch-track);
}
:root[data-theme="light"] .theme-toggle .switch[role="switch"]::before {
  content: "\2600\FE0F";
  translate: 0 0;
  background-color: var(--theme-thumb);
}
.theme-changing .theme-toggle .switch[role="switch"]::before {
  animation: theme-spin var(--theme-transition);
}
@keyframes theme-spin {
  from {
    rotate: 0deg;
  }
  to {
    rotate: 360deg;
  }
}

/* Main and footer */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-block: var(--space-8) var(--space-12);
}
/* <main> gets focus after in-page navigation (so screen readers announce the
   new page) but isn't a control, so it never shows a focus ring. */
main:focus,
main:focus-visible {
  outline: none;
}

.site-footer {
  padding-block: var(--space-6);
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  padding: 0;
  list-style: none;
}
/* The links are logos, all in the footer's text color (and the page's on hover). */
.footer-links a {
  display: block;
  padding: var(--space-1);
}
.icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}
.site-footer a {
  color: inherit;
}
.site-footer a:hover {
  color: var(--foreground);
}

/* Text */

.narrow {
  width: 100%;
  max-width: var(--narrow-width);
}
.narrow.centered {
  margin-inline: auto;
}
/* The home page: the text with the photo to its right, or below it on narrow
   screens. The photo's width and height attributes reserve its space. */
.home {
  display: grid;
  grid-template-columns: minmax(0, var(--narrow-width)) minmax(10rem, 18rem);
  justify-content: space-between;
  align-items: start;
  gap: var(--space-8) var(--space-12);
}
.headshot {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}
@media (max-width: 48rem) {
  .home {
    grid-template-columns: minmax(0, 1fr);
  }
  .headshot {
    max-width: 18rem;
  }
}
.muted {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.lede {
  max-width: var(--narrow-width);
  color: var(--muted-foreground);
  font-size: var(--text-lg);
  text-wrap: pretty;
}
.page-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.prose {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  line-height: var(--leading-relaxed);
  text-wrap: pretty;
}
.prose h2 {
  margin-top: var(--space-4);
}
.prose :is(ul, ol) {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-inline-start: var(--space-6);
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.prose blockquote {
  padding-inline-start: var(--space-4);
  border-inline-start: 3px solid var(--border);
  color: var(--muted-foreground);
}
/* A video as a thumbnail linking to it (the CSP frames nothing from other sites).
   The box is a fixed 16:9, so the image can't shift the layout, and the play
   button marks it as a video. */
.video {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.video a {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video a::after {
  content: "▶";
  position: absolute;
  inset: 50% auto auto 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: var(--space-12);
  height: var(--space-12);
  padding-inline-start: var(--space-1);
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--background) 75%, transparent);
  color: var(--foreground);
  font-size: var(--text-lg);
  transition: background var(--transition);
}
.video a:hover::after {
  background: var(--background);
}
.video figcaption {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
/* Footnotes: a post's <footer class="footnotes">, linked from <sup> numbers in the text. */
.prose sup {
  line-height: 0;
}
.footnotes {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}
.footnotes ol {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-inline-start: var(--space-6);
}
/* Code blocks scroll sideways instead of wrapping, so indentation stays readable. */
.prose pre {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  white-space: pre;
  overflow-x: auto;
}
.prose pre code {
  font-size: inherit;
}
.prose > .lede {
  color: var(--foreground);
}

/* Cards (projects, publications, recommendations)
 *
 * Every card is --tile-height tall: the face (art, title, tagline; or for a
 * publication its title, venue and date) links to the project, and the tab row
 * along the bottom has a Link tab (the same link) and a Description tab, the
 * <summary> of a <details>. Opening it makes the card exactly twice as tall, and
 * the description fills the new half, scrolling if it's longer. The open card
 * lies over whatever is below it rather than pushing it down: a negative bottom
 * margin cancels the extra height, so its grid row keeps its size. Fixed heights
 * (images are fitted inside them) mean nothing shifts as the page loads.
 */
.tiles {
  --tile-height: 20rem;
  --tile-min-width: 15rem;
  --tile-tab-height: 2.5rem;
  --tile-border: 1px;
  --tile-title-lines: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--tile-min-width), 100%), 1fr));
  align-items: start;
  gap: var(--space-6);
  padding: 0;
  list-style: none;
}
/* Publications have long titles and no pictures: wider cards, just tall enough
   for a four-line title with its venue and date. */
.tiles.publications {
  --tile-height: 15rem;
  --tile-min-width: 18rem;
  --tile-title-lines: 4;
}
.card.tile {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: calc(var(--tile-height) - var(--tile-tab-height) - 2 * var(--tile-border)) var(--tile-tab-height);
  gap: 0;
  height: var(--tile-height);
  padding: 0;
  border-width: var(--tile-border);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card.tile:has(> .tile-details[open]) {
  z-index: 1;
  height: calc(2 * var(--tile-height));
  margin-bottom: calc(-1 * var(--tile-height));
  border-color: var(--tone);
  box-shadow: 0 12px 32px -8px oklch(0 0 0 / 0.45);
}
.card.tile:hover:not(:has(> .tile-details[open])) {
  border-color: color-mix(in oklab, var(--tone) 60%, var(--border));
  box-shadow: 0 4px 16px -6px color-mix(in oklab, var(--tone) 45%, transparent);
}

.tile-face {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  color: inherit;
  text-decoration: none;
}
.tile-face:focus-visible {
  outline-offset: -3px;
}
/* The lettered cover, with the site's image (if any) over it. */
.tile-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  padding-inline: var(--space-4);
  background-image: linear-gradient(135deg, var(--tone), color-mix(in oklab, var(--tone) 70%, black));
  color: oklch(1 0 0);
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-align: center;
}
/* og:images come in all shapes (usually 1.91:1), so they're shown whole, over the card's color. */
.tile-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* A site's icon rather than a share image (it has none): smaller, centered on the
   card's color, with no lettering behind it. */
.tile-icon {
  inset: 20%;
  width: 60%;
  height: 60%;
}
.tile-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4) var(--space-4);
}
.tile-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--tile-title-lines);
  font-size: var(--text-base);
}
/* Always two lines tall, so every card's picture is the same size whether its
   tagline takes one line or two. */
.tile-tagline {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-height: 2lh;
  color: var(--muted-foreground);
}

/* A publication's face: title, venue and date, under a strip of the card's color. */
.publication .tile-face {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  border-top: 4px solid var(--tone);
}
.publication .tile-face > * {
  flex-shrink: 0;
}
.publication .tile-title {
  margin-bottom: var(--space-1);
}
.publication-venue,
.publication-date {
  color: var(--muted-foreground);
}
.publication-authors {
  margin-bottom: var(--space-2);
  font-weight: var(--weight-medium);
}

.tile-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--tile-tab-height);
  border-top: 1px solid var(--border);
  background-color: color-mix(in oklab, var(--muted) 45%, var(--card));
  color: var(--muted-foreground);
  font-weight: var(--weight-medium);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition), background-color var(--transition);
}
.tile-tab:hover,
.tile-details[open] > .tile-tab {
  background-color: var(--card);
  color: var(--foreground);
}
.tile-link {
  grid-area: 2 / 1;
  border-inline-end: 1px solid var(--border);
}
.tile-details {
  grid-area: 2 / 2;
}
.tile-details > summary {
  list-style: none;
}
.tile-details > summary::-webkit-details-marker {
  display: none;
}
.tile-details > summary:focus-visible {
  outline-offset: -3px;
}
.tile-details > summary::after {
  content: "";
  width: 0.4em;
  height: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  rotate: 45deg;
  translate: 0 -0.15em;
  transition: rotate var(--transition), translate var(--transition);
}
.tile-details[open] > summary::after {
  rotate: 225deg;
  translate: 0 0.15em;
}
/* The description fills the card's second half, the space below the tabs. */
.tile-panel {
  position: absolute;
  inset: calc(var(--tile-height) - 2 * var(--tile-border)) 0 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  line-height: var(--leading-relaxed);
}
/* Text scrolling out of the panel fades rather than being cut mid-line. */
.tile-panel::after {
  content: "";
  position: sticky;
  bottom: calc(-1 * var(--space-4));
  display: block;
  height: var(--space-6);
  margin-top: calc(-1 * var(--space-6));
  background-image: linear-gradient(transparent, var(--card));
  pointer-events: none;
}
.tile-panel:focus-visible {
  outline-offset: -3px;
}

.tone-red {
  --tone: oklch(0.6 0.17 25);
}
.tone-orange {
  --tone: oklch(0.66 0.16 50);
}
.tone-amber {
  --tone: oklch(0.7 0.14 80);
}
.tone-green {
  --tone: oklch(0.6 0.13 150);
}
.tone-teal {
  --tone: oklch(0.6 0.1 195);
}
.tone-blue {
  --tone: oklch(0.58 0.15 250);
}
.tone-indigo {
  --tone: oklch(0.52 0.16 275);
}
.tone-violet {
  --tone: oklch(0.56 0.16 305);
}
.tone-pink {
  --tone: oklch(0.63 0.17 350);
}
.tone-slate {
  --tone: oklch(0.5 0.03 260);
}

/* Blog */

.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: var(--narrow-width);
  padding: 0;
  list-style: none;
}
.post-item h2 a {
  color: var(--foreground);
  text-decoration: none;
}
.post-item h2 a:hover {
  text-decoration: underline;
}
.post {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.post-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.post-header a {
  color: inherit;
}
