/* Fraunces, self-hosted (SIL Open Font License), with its wonky and soft axes turned up. */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/fraunces.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: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/fraunces-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-20C4, 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(/fonts/fraunces-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: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap; src: url(/fonts/fraunces-italic-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #fff;
  --fg: #161616;
  --muted: #707070;
  --link: #1a0dab;
  --visited: #681da8;
  --rule: #e4e4e4;
  --mark: #fff0a0;
  --h0: #eeeeee;
  --h1: #b5b5b5;
  --h2: #858585;
  --h3: #525252;
  --h4: #161616;
  --grid: #e8e8e8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #dedede;
    --muted: #8c8c8c;
    --link: #8ab4f8;
    --visited: #c58af9;
    --rule: #2c2c2c;
    --mark: #5c5200;
    --h0: #1f1f1f;
    --h1: #4d4d4d;
    --h2: #7a7a7a;
    --h3: #a8a8a8;
    --h4: #e6e6e6;
    --grid: #262626;
  }
}

html {
  font-size: 112.5%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Fraunces, "Iowan Old Style", Palatino, Georgia, serif;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 34rem;
  margin: 0 0 0 max(1rem, 13vw);
  padding: 3.5rem 1rem 5rem 0;
}

@media (max-width: 640px) {
  html { font-size: 106.25%; }
  .page { margin: 0; padding: 1.75rem 1rem 4rem; }
}

::selection { background: var(--mark); color: inherit; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:visited { color: var(--visited); }
a:hover { text-decoration-thickness: 2px; }

nav { font-size: .9rem; color: var(--muted); }
nav a, nav a:visited { color: var(--fg); }
nav span { color: var(--fg); }

h1 { font-size: 2.25rem; font-weight: 600; line-height: 1.25; margin: 2.5rem 0 .2rem; }
h2 { font-size: 1rem; font-weight: normal; font-style: italic; margin: 2.2rem 0 .4rem; }
p, ul { margin: 0 0 1rem; }
ul { padding-left: 1.2rem; }
li { margin-bottom: .5rem; }
blockquote { margin: 0 0 1rem; padding-left: 1rem; border-left: 1px solid var(--rule); font-style: italic; }

.date { color: var(--muted); font-style: italic; margin: 0 0 2rem; }
.quiet { color: var(--muted); }

.index { list-style: none; padding: 0; margin-top: 2rem; }
.index li { display: flex; gap: 1rem; margin-bottom: .45rem; }
.index time { flex: 0 0 4.5rem; color: var(--muted); font-size: .85rem; padding-top: .15rem; font-variant-numeric: tabular-nums; }

.entry { margin-bottom: 1.1rem; }
.entry b { font-weight: 600; }

footer { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }
footer a, footer a:visited { color: var(--muted); }

/* Charts. One series each: marks are --h3, the one that matters is --h4. */
.chart { position: relative; margin: 1rem 0 .5rem; }
.chart svg { display: block; overflow: visible; }
.chart text { font-family: inherit; font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .bar { fill: var(--h3); pointer-events: none; }
.chart text, .chart .grid { pointer-events: none; }
.chart a text { pointer-events: auto; }
.chart .bar.on { fill: var(--h4); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .bar, .chart .hit:focus + .bar { fill: var(--h4); }
.chart .hit:focus { outline: none; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heat rect.d { shape-rendering: crispEdges; }
.heat rect.d:hover { stroke: var(--fg); stroke-width: 1; }

#tip {
  position: fixed; z-index: 10; pointer-events: none; display: none;
  background: var(--bg); color: var(--fg); border: 1px solid var(--rule);
  padding: .35rem .55rem; font-size: .8rem; line-height: 1.35; max-width: 16rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
#tip b { font-weight: 600; display: block; font-variant-numeric: tabular-nums; }
#tip span { color: var(--muted); display: block; }

.caption { font-size: .85rem; color: var(--muted); margin: 0 0 .25rem; }
.hero { font-size: 3.6rem; line-height: 1; margin: 2.2rem 0 .3rem; letter-spacing: -.01em; }
.facts { display: flex; gap: 2rem; flex-wrap: wrap; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.facts li { margin: 0; }
.facts b { display: block; font-size: 1.35rem; font-weight: normal; }
.facts span { font-size: .8rem; color: var(--muted); }

.toc { list-style: none; padding: 0; margin: 2rem 0; font-size: .95rem; }
.toc li { display: flex; align-items: baseline; margin: 0 0 .2rem; }
.toc a { flex: none; }
.toc i { flex: 1; border-bottom: 1px dotted var(--muted); margin: 0 .4rem; transform: translateY(-.25em); }
.toc em { flex: none; color: var(--muted); font-size: .85rem; }

.rows { list-style: none; padding: 0; margin: 0 0 1rem; }
.rows li { display: flex; justify-content: space-between; gap: 1rem; margin: 0; padding: .3rem 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }
.rows li span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.rows .lang { display: block; padding-bottom: .55rem; }
.rows .lang div { display: flex; justify-content: space-between; }
.rows .lang i { display: block; height: 3px; margin-top: .3rem; background: var(--h3); border-radius: 0 2px 2px 0; }
.rows .lang:first-child i { background: var(--h4); }

.toggle { font-size: .85rem; margin: .25rem 0 .75rem; }
.toggle button { font: inherit; background: none; border: 0; padding: 0; margin-right: 1rem; color: var(--muted); cursor: pointer; }
.toggle button[aria-pressed="true"] { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

.month { margin-top: 1rem; }
.month h3 { font-size: 1rem; font-weight: normal; margin: 0 0 .4rem; }
.small { font-size: .85rem; color: var(--muted); }

details { margin: .25rem 0 1rem; font-size: .85rem; }
summary { color: var(--muted); cursor: pointer; }
details table { border-collapse: collapse; margin-top: .5rem; width: 100%; font-variant-numeric: tabular-nums; }
details td, details th { text-align: left; padding: .15rem .5rem .15rem 0; border-bottom: 1px solid var(--rule); font-weight: normal; }
details td:last-child, details th:last-child { text-align: right; padding-right: 0; }

.strip { margin: 1.2rem 0 2rem; }

.index.work li { margin-bottom: .55rem; font-size: .95rem; line-height: 1.45; }
.index.work time { flex-basis: 4.5rem; }
@media (max-width: 640px) {
  .index.work li { flex-direction: column; gap: 0; }
  .index.work time { flex-basis: auto; font-size: .8rem; }
  .index.work time:empty { display: none; }
}

.books { list-style: none; padding: 0; }
.books li { margin: 0 0 .35rem; }
.page > ul:last-child { margin-bottom: 3rem; }

/* Good stuff */
.art { margin: 2rem 0 1rem; }
.art img { display: block; width: 100%; max-width: 22rem; height: auto; }
.videos { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.25rem 1rem; }
.video { margin: 0; }
.video a, .video a:visited { color: var(--fg); text-decoration: none; display: block; }
.video img, .video iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; background: var(--h0); }
.video a:hover .v-title { text-decoration: underline; }
.v-title { display: block; font-size: .92rem; line-height: 1.35; margin-top: .4rem; }
.v-who { display: block; font-size: .8rem; color: var(--muted); }
blockquote .small { font-style: normal; display: block; margin-top: .4rem; }
blockquote p { margin: 0 0 .75rem; }
blockquote + blockquote { margin-top: 1.5rem; }
.pic { margin: 0 0 1.75rem; }
.pic img { display: block; width: 100%; height: auto; }
.pic figcaption { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.bloom svg { width: 100%; height: auto; }
.bloom text { font-size: 15px; }
.bloom text.lbl { fill: var(--fg); }
.pic.shot img { border: 1px solid var(--rule); }
.pic.two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.pic.two img { height: 100%; object-fit: cover; }
.pic.narrow img { max-width: 24rem; }
.pic.msgs { align-items: start; }
.pic.msgs img { height: auto; }

.videos.one { grid-template-columns: 1fr; }

/* Photo links: a plain link that opens the picture over the page */
.photo-overlay { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; padding: 1rem; background: rgba(0, 0, 0, .86); cursor: zoom-out; }
.photo-overlay img { max-width: min(92vw, 70rem); max-height: 82vh; width: auto; height: auto; display: block; }
.photo-overlay p { color: #ddd; font-size: .9rem; margin: 0; text-align: center; }
.photo-overlay button { position: absolute; top: .75rem; right: 1rem; font: inherit; font-size: 1.6rem; line-height: 1; color: #ddd; background: none; border: 0; cursor: pointer; }

/* /chess */
:root { --sq-light: #f0d9b5; --sq-dark: #b58863; }
.chess-bar { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1.25rem 0 .75rem; }
.chess-bar button { font: inherit; font-size: .95rem; color: var(--link); background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer; }
.chess-bar button:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.board-wrap { position: relative; width: 100%; max-width: 30rem; }
.board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; border-radius: 3px; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.sq { position: relative; display: block; padding: 0; border: 0; border-radius: 0; font: inherit; cursor: pointer; aspect-ratio: 1; min-width: 0; -webkit-tap-highlight-color: transparent; }
.sq.light { background-color: var(--sq-light); }
.sq.dark { background-color: var(--sq-dark); }
.sq.last { box-shadow: inset 0 0 0 100vmax rgba(155, 199, 0, .41); }
.sq.sel { box-shadow: inset 0 0 0 100vmax rgba(20, 85, 30, .5); }
.sq.check { background-image: radial-gradient(ellipse at center, #f00 0%, #e70000 25%, rgba(169, 0, 0, 0) 89%, rgba(158, 0, 0, 0) 100%); }
.sq.hang { background-image: linear-gradient(225deg, rgba(200, 30, 30, .85) 0 13%, transparent 13%); }
.sq.dot { background-image: radial-gradient(rgba(20, 85, 30, .5) 19%, transparent 20%); }
.sq.take { background-image: radial-gradient(transparent 0%, transparent 79%, rgba(20, 85, 0, .3) 80%); }
.sq:focus-visible { outline: 2px solid var(--link); outline-offset: -2px; z-index: 1; }
.coord { position: absolute; font-size: .62rem; font-weight: 600; line-height: 1; pointer-events: none; }
.sq.light .coord { color: var(--sq-dark); }
.sq.dark .coord { color: var(--sq-light); }
.coord.r { top: .18rem; left: .22rem; }
.coord.f { right: .22rem; bottom: .15rem; }
.pc { position: absolute; inset: 1%; width: 98%; height: 98%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.pc.lifted { opacity: .3; }
.pc.ghost { position: fixed; inset: auto; left: 0; top: 0; z-index: 30; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }
.arrows { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.arrows line { stroke: rgba(21, 120, 27, .8); stroke-width: .16; stroke-linecap: round; }
.arrows polygon { fill: rgba(21, 120, 27, .8); }
.chess-status { min-height: 1.55em; margin-top: .75rem; color: var(--muted); }
