:root {
  --paper: #fff8dc;
  --paper-2: #fff4cf;
  --desk: #e9dfbc;
  --ink: #1f1a14;
  --ink-soft: #5a4632;
  --rule: #c7a86c;
  --rule-soft: #ddc89a;
  --frame: #8d7a58;
  --link: #039;
  --link-visited: #5b2c88;
  --code-bg: #f4ecd4;
  --hazard-a: #c7a86c;
  --hazard-b: #1f1a14;
  --measure: 70ch;
  --shell: 900px;
}

html[data-theme="dark"] {
  --paper: #211c15;
  --paper-2: #2a241b;
  --desk: #14110c;
  --ink: #e7dcc2;
  --ink-soft: #b6a884;
  --rule: #6b5a3a;
  --rule-soft: #4a3f2a;
  --frame: #8d7a58;
  --link: #8fb6ff;
  --link-visited: #c9a9ec;
  --code-bg: #2f2819;
  --hazard-a: #6b5a3a;
  --hazard-b: #e7dcc2;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--desk);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

body {
  margin: 0;
  color: var(--ink);
  background: transparent;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 18px;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
}

a:visited {
  color: var(--link-visited);
}

a:hover {
  color: var(--ink);
}

a:focus-visible,
button:focus-visible {
  outline: 2px dotted var(--link);
  outline-offset: 2px;
}

a.fn {
  text-decoration: none;
  font-size: 0.72em;
  vertical-align: super;
}

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 700;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 1.5rem 0;
}

blockquote {
  margin: 1rem 0 1rem 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--ink-soft);
  font-style: italic;
}

code,
kbd,
samp {
  padding: 0 0.2rem;
  background-color: var(--code-bg);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.92em;
}

.site-shell {
  max-width: var(--shell);
  margin: 1.25rem auto;
  padding: 1.5rem 1.75rem 2.25rem;
  background-color: var(--paper);
  border: 1px solid var(--rule);
  box-shadow:
    0 1px 0 var(--rule),
    0 2px 14px rgb(31 26 20 / 12%);
}

.site-shell.reading {
  max-width: 760px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dotted var(--rule);
}

.topbar nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.topbar a {
  text-decoration: none;
}

.topbar a:hover {
  text-decoration: underline;
}

.theme-toggle {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
  color: var(--link);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}

.theme-toggle:hover {
  color: var(--ink);
  text-decoration: underline;
}

.site-header {
  margin-bottom: 1.5rem;
}

.site-title {
  margin: 0 0 0.4rem;
  font-size: 2.1rem;
  letter-spacing: 0.01em;
}

.site-tagline {
  margin: 0 0 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

.site-subtitle {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.lede {
  font-size: 1.05rem;
}

.intro-figure {
  float: right;
  width: min(220px, 32%);
  margin: 0.25rem 0 0.85rem 1.25rem;
}

.intro-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--frame);
  background: var(--paper-2);
  padding: 5px;
}

.intro-figure figcaption {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  text-align: center;
}

.toc {
  margin: 1.5rem 0;
}

.toc-title {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.6rem;
}

ol.index,
ul.index {
  list-style: none;
  margin: 0;
  padding: 0;
}

ol.index li,
ul.index li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px dotted var(--rule-soft);
}

.index .num {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  min-width: 1.6em;
}

.index .label {
  white-space: nowrap;
}

.index .leader {
  flex: 1;
  border-bottom: 1px dotted var(--rule);
  transform: translateY(-0.25em);
  min-width: 1rem;
}

.index .blurb {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-section,
.archive-section {
  clear: both;
  margin: 1.75rem 0;
  padding: 1rem 1.15rem 1.15rem;
  border: 1px solid var(--rule);
  background-color: var(--paper-2);
}

.content-section h2,
.archive-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.4rem;
}

.content-section h2 a,
.archive-section h2 a {
  text-decoration: none;
}

.content-section h2 a:hover,
.archive-section h2 a:hover {
  text-decoration: underline;
}

.plain-list,
.note-list,
.link-list {
  padding-left: 1.25rem;
}

.plain-list li,
.note-list li,
.link-list li {
  margin: 0.3rem 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0.6rem 0 0;
  list-style: none;
}

.chips li {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--rule);
  background: var(--paper);
}

.flow-figure-left,
.flow-figure-right {
  margin: 0 0 0.85rem;
}

.flow-figure-left {
  float: left;
  margin-right: 1rem;
  width: min(300px, 42%);
}

.flow-figure-right {
  float: right;
  margin-left: 1rem;
  width: min(300px, 42%);
}

.flow-figure-right.narrow {
  width: min(240px, 28%);
}

.flow-figure-right.tiny {
  width: min(150px, 22%);
}

.flow-figure-left img,
.flow-figure-right img {
  display: block;
  border: 1px solid var(--frame);
  background: var(--paper-2);
  padding: 4px;
}

.flow-figure-left figcaption,
.flow-figure-right figcaption {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  text-align: center;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.photo-card {
  padding: 0.75rem;
  border: 1px solid var(--rule);
  background-color: var(--paper);
}

.photo-card figure {
  margin: 0 0 0.6rem;
}

.photo-card img {
  display: block;
  width: 100%;
  border: 1px solid var(--frame);
}

.photo-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.08rem;
}

.photo-card p {
  margin: 0;
}

.section-lead {
  margin: 0 0 1rem;
}

.movie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}

.movie-table td {
  padding: 0.85rem 0.75rem;
  vertical-align: top;
}

.movie-table tr {
  border-bottom: 1px dotted var(--rule);
}

.movie-table tr:last-child {
  border-bottom: 0;
}

.movie-table .poster-cell {
  width: 200px;
}

.movie-table .poster-cell img {
  display: block;
  border: 1px solid var(--frame);
  padding: 3px;
  background: var(--paper);
}

.movie-table .entry-heading {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.align-right {
  text-align: right;
}

.timeline {
  margin-top: 1rem;
  padding-left: 1.5rem;
  border-left: 3px solid var(--rule);
}

.timeline-entry {
  position: relative;
  margin: 1rem 0 1.9rem;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -1.86rem;
  top: 0.55rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--rule);
  border-radius: 50%;
  background-color: var(--paper);
}

.timeline-entry h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.timeline-date {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.timeline-label {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.timeline-entry p {
  margin: 0.45rem 0;
}

.timeline-logo {
  float: left;
  width: 90px;
  margin: 0.25rem 1rem 0.5rem 0;
}

.timeline-logo img {
  display: block;
  width: 100%;
  border: 1px solid var(--frame);
  background: #fff;
  padding: 4px;
}

.under-construction {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1.25rem 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  font-size: 0.85rem;
  font-family: "Courier New", Courier, monospace;
  color: var(--ink-soft);
}

.hazard {
  height: 12px;
  flex: 1;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--hazard-b) 0,
    var(--hazard-b) 8px,
    var(--hazard-a) 8px,
    var(--hazard-a) 16px
  );
  background-size: 22.6px 22.6px;
  animation: crawl 1.6s linear infinite;
  opacity: 0.7;
}

@keyframes crawl {
  to {
    background-position: 22.6px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hazard {
    animation: none;
  }
}

.stamp {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.05rem 0.45rem;
  border: 1px dashed var(--rule);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.contact {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
}

.nav-box {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  margin-bottom: 1.1rem;
}

.nav-box > .nav-box-title {
  margin: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink-soft);
}

.nav-box ul {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0;
}

.nav-box li {
  padding: 0;
}

.nav-box li a {
  display: block;
  padding: 0.28rem 0.7rem;
  text-decoration: none;
  border-bottom: 1px dotted var(--rule-soft);
}

.nav-box li:last-child a {
  border-bottom: 0;
}

.nav-box li a:hover {
  background: var(--paper);
  text-decoration: underline;
}

.nav-box .facts {
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.nav-box .facts p {
  margin: 0.25rem 0;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 1.25rem;
}

.masthead img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border: 1px solid var(--frame);
  padding: 4px;
  background: var(--paper-2);
  flex: none;
}

.masthead .site-title {
  margin: 0 0 0.2rem;
}

.columns {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.columns aside {
  position: sticky;
  top: 1rem;
}

.page-footer {
  clear: both;
  margin-top: 2rem;
  padding-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.page-footer .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.page-footer a {
  text-decoration: none;
}

.page-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .site-shell {
    margin: 0;
    border: 0;
    padding: 1rem 1rem 2rem;
  }

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

  .columns aside {
    position: static;
  }

  .intro-figure {
    float: none;
    width: 180px;
    margin: 0 auto 1rem;
  }

  .flow-figure-left,
  .flow-figure-right {
    float: none;
    width: 100%;
    max-width: 320px;
    margin: 0 auto 1rem;
  }

  .movie-table,
  .movie-table tbody,
  .movie-table tr,
  .movie-table td {
    display: block;
    width: 100%;
  }

  .movie-table .poster-cell {
    width: auto;
  }

  .site-title {
    font-size: 1.7rem;
  }

  .index .blurb {
    display: none;
  }
}

@media print {
  html {
    background: #fff;
  }

  .topbar,
  .under-construction,
  .theme-toggle {
    display: none;
  }

  .site-shell {
    box-shadow: none;
    border: 0;
    max-width: none;
  }
}
