@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Fraunces;
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-ext-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Fraunces;
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/fraunces-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Outfit;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --wall: #e6ddd0;
  --ink: #1c1612;
  --muted: #4f463c;
  --line: rgba(28, 22, 18, 0.16);
  --plaque: #f6f1e8;
  --frame: #f4eee4;
  --mat: #ebe3d4;
  --button: #1c1612;
  --button-ink: #f6f0e6;
  --accent: #8d341f;
  --shadow: 0 14px 34px rgba(72, 44, 18, 0.12);
  --header: rgba(230, 221, 208, 0.94);
  --code: #f7f2ea;
  --focus: #8d341f;
  --serif: Fraunces, "Iowan Old Style", Palatino, Georgia, serif;
  --sans: Outfit, "Avenir Next", "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --wall: #12110f;
  --ink: #f3ecdf;
  --muted: #cbbba8;
  --line: rgba(243, 236, 223, 0.16);
  --plaque: #221f1b;
  --frame: #1c1a17;
  --mat: #171512;
  --button: #f3ecdf;
  --button-ink: #171512;
  --accent: #f0b59f;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  --header: rgba(18, 17, 15, 0.94);
  --code: #1c1a17;
  --focus: #f0b59f;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 430;
}

body,
a,
button,
input {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: #e7c2b2;
  color: #1c1612;
}

:root[data-theme="dark"] ::selection {
  background: #6d3d2e;
  color: #f6f0e6;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover {
  text-decoration-thickness: 2px;
}

h1,
h2,
h3,
.brand-name {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

h1 {
  margin: 0 0 0.4em;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
}

h2 {
  margin: 0;
  font-size: 1.45rem;
}

p {
  margin: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.92em;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 20;
  background: var(--plaque);
  color: var(--ink);
  padding: 8px 12px;
}

.skip:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner,
.wrap,
.footer-inner {
  width: min(1120px, calc(100% - 24px));
  margin-inline: auto;
}

.header-inner {
  padding-top: 12px;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-name {
  font-size: 1.55rem;
  color: var(--ink);
}

.brand-name span {
  font-style: italic;
  font-weight: 480;
}

.brand-tag {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.theme-switch {
  display: inline-flex;
  flex: none;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--plaque);
}

.theme-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 560;
  line-height: 1;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.theme-switch button[aria-pressed="true"] {
  background: var(--button);
  color: var(--button-ink);
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 560;
  margin-right: 18px;
  padding: 10px 0 12px;
  min-height: 44px;
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 7px;
}

main {
  padding: 32px 0 72px;
}

.lede {
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.12rem;
}

.toolbar {
  display: grid;
  gap: 16px;
  margin: 28px 0 22px;
}

.search {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--plaque);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filters button {
  appearance: none;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.filters button[aria-pressed="true"] {
  background: var(--button);
  color: var(--button-ink);
  border-color: var(--button);
}

.empty {
  margin: 12px 0 24px;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px 22px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.card-open {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.card-open h2 {
  font-size: 1.55rem;
}

.frame {
  background: var(--frame);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 8px;
}

.mat {
  background: var(--mat);
  padding: 8px;
}

.canvas {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: auto;
  font-size: 12px;
  line-height: 0;
  background: transparent;
}

.canvas .katex-display {
  margin: 0;
}

.byline {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-summary {
  color: var(--muted);
  font-size: 0.98rem;
}

.copy-button {
  appearance: none;
  width: 100%;
  min-height: 44px;
  margin-top: auto;
  border: 0;
  border-radius: 2px;
  background: var(--button);
  color: var(--button-ink);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
}

.copy-button.is-copied {
  background: var(--accent);
  color: #1c1612;
}

:root[data-theme="light"] .copy-button.is-copied {
  color: #fff8f3;
}

.copy-row {
  display: grid;
  gap: 8px;
}

.copy-row .copy-button {
  width: auto;
  min-width: min(100%, 220px);
  padding: 0 18px;
}

.copy-status {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.95rem;
}

.detail {
  display: grid;
  justify-items: center;
  text-align: center;
}

.detail > * {
  width: min(100%, 40rem);
}

.detail .frame {
  width: fit-content;
  max-width: 100%;
}

.kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker a {
  color: inherit;
}

.detail .byline {
  margin-top: 8px;
}

.detail .tags {
  justify-content: center;
  margin: 10px 0 18px;
}

.note {
  margin-top: 22px;
  text-align: left;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 28px;
  margin: 8px 0 28px;
  padding: 0;
}

.facts div {
  min-width: 140px;
}

.facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.facts dd {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.detail h2,
.about h2 {
  margin: 36px 0 10px;
  text-align: left;
}

.hint {
  margin-bottom: 10px;
  color: var(--muted);
  text-align: left;
}

.source {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--code);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: min(100%, 40rem);
  margin-top: 36px;
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--plaque);
  color: inherit;
  text-decoration: none;
  text-align: left;
}

.pager-next {
  text-align: right;
  align-items: flex-end;
}

.pager-link span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pager-link strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 560;
}

.about ol,
.about ul {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.about li + li {
  margin-top: 4px;
}

.about .frame {
  width: fit-content;
  max-width: 100%;
  margin: 18px auto;
}

.about .canvas {
  font-size: 1.65rem;
  padding: 18px 28px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-inner {
  display: grid;
  gap: 8px;
}

@media (max-width: 420px) {
  .brand-tag {
    display: none;
  }

  .header-inner,
  .wrap,
  .footer-inner {
    width: min(1120px, calc(100% - 20px));
  }

  .theme-switch button {
    padding: 0 12px;
  }
}

@media (min-width: 720px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
  }

  .mat {
    padding: 14px;
  }

  .frame {
    padding: 12px;
  }
}

@media (min-width: 800px) {
  .toolbar {
    grid-template-columns: 260px 1fr;
    align-items: end;
  }
}

@media (min-width: 1040px) {
  .gallery {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .detail .canvas {
    zoom: 1.45;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .frame {
    transition: transform 160ms ease;
  }

  .card:hover .frame {
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .frame {
    transition: none;
  }
}
