/* danshipper.com — white paper, Signifier Light, the blue.
   A modernized continuation of the old site's look (Emptiness theme, 2017).
   Always light — like the old site. */

@font-face {
  font-family: "Signifier";
  src: url("/fonts/signifier-light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #474747;
  --strong: #222222;
  --faded: #8f8f8f;
  --accent: #0578cd;        /* body links — AA on white */
  --accent-bright: #0599ff; /* the old site's blue — hovers & large accents */
  --rule: #e9e9e9;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html {
  color-scheme: light only;
  background: var(--paper);
  color: var(--ink);
  font-family: "Signifier", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-weight: 300;
  font-synthesis-weight: none;
  font-size: clamp(18px, 1.05vw + 14px, 20px);
  line-height: 1.62;
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; }

main {
  max-width: 41rem;
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 6.5rem) 1.375rem 4rem;
}

@media (prefers-reduced-motion: no-preference) {
  main {
    animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  @keyframes rise {
    from { opacity: 0; transform: translateY(0.75rem); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- hero ---------- */

header.hero {
  display: grid;
  grid-template-columns: 1fr 11.5rem;
  gap: 0 2.25rem;
  align-items: start;
}

img.portrait {
  width: 100%;
  height: auto;
  border-radius: 3px;
  margin-top: 0.9rem;
}

@media (max-width: 600px) {
  header.hero { grid-template-columns: 1fr; }
  img.portrait { width: 8.5rem; order: -1; margin: 0 0 1.5rem; }
}

/* ---------- type ---------- */

h1 {
  font-size: clamp(2.5rem, 7.5vw, 4rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--strong);
  margin: 0 0 1.75rem;
}

h2 {
  font-size: 1.35rem;
  font-weight: 300;
  color: var(--strong);
  margin: 0 0 1.25rem;
}

h3 {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--strong);
  margin: 1.5rem 0 0.25rem;
}

p { margin: 0 0 1.1rem; }

b, strong { font-weight: 300; color: var(--strong); }

section {
  margin-top: 4rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}

.lede {
  font-size: 1.17rem;
  line-height: 1.55;
}

small, .small { font-size: 0.85rem; color: var(--faded); }

/* ---------- links: the blue ---------- */

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  color: var(--accent-bright);
  text-decoration-color: var(--accent-bright);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 1px;
  text-decoration: none;
}

nav.crumb a, footer a { color: var(--accent); }

/* ---------- lists with date gutters ---------- */

ul.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul.ledger > li {
  display: grid;
  grid-template-columns: 4.75rem 1fr;
  gap: 0 1.1rem;
  padding: 0.55rem 0;
}

ul.ledger .when {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faded);
  padding-top: 0.45em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

ul.ledger .what .note {
  display: block;
  color: var(--faded);
  font-size: 0.92rem;
  margin-top: 0.1rem;
}

/* press lists: outlet as a small eyebrow above the headline */
ul.ledger .outlet {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faded);
  margin-bottom: 0.2rem;
}

ul.ledger.press > li { padding: 0.8rem 0; }
ul.ledger.press .when { padding-top: 0.18em; }
ul.ledger.press .what a { font-size: 1.04rem; line-height: 1.35; }

.m-when { display: none; }

@media (max-width: 540px) {
  ul.ledger.press .when { display: none; }
  ul.ledger.press .m-when { display: inline; }
}

@media (max-width: 540px) {
  ul.ledger > li { grid-template-columns: 1fr; }
  ul.ledger .when { padding-top: 0; }
}

/* ---------- talks: thumbnail links, never embedded players ---------- */

.talk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.15rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.talk-grid > li { min-width: 0; }

.talk-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  color: var(--strong);
  text-decoration: none;
}

.talk-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f2f2f2;
  border: 1px solid var(--rule);
  border-radius: 3px;
}

.talk-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 1.2rem 1.3rem 2.7rem;
  background: linear-gradient(135deg, #f1f5f8, #e6eef4);
  color: #52606b;
}
.talk-placeholder > span { font-size: 1.75rem; line-height: 1.1; }
.talk-placeholder > small { margin-top: 0.6rem; color: #66737e; font: 0.55rem/1.5 var(--mono); letter-spacing: 0.01em; }
.talk-image img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.talk-image img[hidden] { display: none; }

.talk-play {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: #222;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 8px #0002;
}

.talk-play svg { margin-left: 1px; }

.talk-duration {
  position: absolute;
  right: 0.6rem;
  bottom: 0.65rem;
  padding: 0.1rem 0.3rem;
  border-radius: 2px;
  color: #fff;
  background: #111d;
  font-family: var(--mono);
  font-size: 0.62rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.talk-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.8rem;
  color: #686868;
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: 0.065em;
}

.talk-meta > span { letter-spacing: 0; white-space: nowrap; }
.talk-card h3 { margin: 0.4rem 0 0.6rem; font-size: 1.15rem; line-height: 1.3; }
.talk-watch { margin-top: auto; color: var(--accent); font-size: 0.79rem; }
.talk-watch > span { display: inline-block; margin-left: 0.12rem; }
.talk-card:hover h3 { color: var(--accent); }
.talk-card:hover .talk-watch { text-decoration: underline; text-underline-offset: 0.16em; }
.talk-card:focus-visible { outline-offset: 6px; border-radius: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .talk-image img { transition: transform 180ms ease; }
  .talk-card:hover .talk-image img { transform: scale(1.025); }
}

@media (max-width: 600px) {
  .talk-grid { grid-template-columns: 1fr; gap: 2rem; }
  .talk-card h3 { font-size: 1.2rem; }
  .talk-meta { font-size: 0.63rem; }
}

/* ---------- books: the reading shelf ---------- */

/* No italic is loaded, so a book title is marked the way all emphasis is here: by colour. */
.ledger cite, .shelf cite { font-style: normal; color: var(--strong); }
.fav { color: var(--accent-bright); }
cite + .fav { margin-left: 0.15em; }

/* On /books each book is one link (to Bookshop.org) around its cover, title and author.
   Only the title looks like a link: the blue and the underline are its own. */
a.book { color: inherit; text-decoration: none; }
a.book cite {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}
a.book:hover cite { color: var(--accent-bright); text-decoration-color: var(--accent-bright); }

/* the shelf's text is not ours to proofread: a word longer than the column breaks rather than widening the page */
.ledger cite, .ledger .what .note, .shelf > li { overflow-wrap: anywhere; }

/* the years, to jump by: a small table of year and count */
nav.years {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 1.35rem;
  margin-top: 2.25rem;
  font: 0.72rem/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
nav.years a {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
nav.years a span { color: var(--faded); }

/* lately: covers standing on one line like books on a shelf, whatever their proportions */
.shelf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.75rem 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.shelf > li { min-width: 0; }
.shelf .cover { position: relative; display: block; aspect-ratio: 2 / 3; margin-bottom: 0.8rem; }
.shelf .cover img {
  position: absolute;
  left: 0;
  bottom: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.shelf .typeset {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: 0.8rem;
  overflow: hidden;
  background: linear-gradient(135deg, #f1f5f8, #e6eef4);
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: #52606b;
}
.shelf .typeset > span { font-size: 1.05rem; line-height: 1.15; }
.shelf .typeset > small { margin-top: 0.6rem; color: #66737e; font: 0.55rem/1.5 var(--mono); }
.shelf a.book { display: block; }
.shelf cite { font-size: 0.95rem; line-height: 1.3; }
.shelf .by {
  display: block;
  margin-top: 0.3rem;
  color: #686868;
  font: 0.58rem/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.065em;
}

/* a year: its heading stays at the top of the window while its books scroll under it,
   with the way to the years on either side */
section.year { margin-top: 3rem; padding-top: 0; border-top: 0; }
.year-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.7rem 0 0.55rem;
  margin-bottom: 0.4rem;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.year-head h2 { margin: 0; }
.year-head .n, .year-head .step {
  font: 0.66rem/1.5 var(--mono);
  color: var(--faded);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* the links are small type with a finger's room around each: the padding is theirs, the
   negative margin gives it back to the row */
.year-head .step { display: flex; gap: 0.25rem; margin: -0.6rem -0.4rem -0.6rem auto; }
.year-head .step a { padding: 0.6rem 0.4rem; text-decoration: none; }

/* The site's faded grey is for asides; here it would carry the author and the month of
   every book, so on this page that text is a grey that passes AA on white (5.3:1). */
ul.ledger.books .when, ul.ledger.books .what .note, nav.years a span, .year-head .n { color: #6b6b6b; }

/* a book: the month it starts in the gutter, its cover, then title and author */
ul.ledger.books > li {
  grid-template-columns: 2.1rem 1fr;
  gap: 0 0.95rem;
  align-items: start;
  padding: 0.5rem 0;
}
ul.ledger.books a.book {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0 0.95rem;
  align-items: start;
  min-width: 0;
}
ul.ledger.books .when { padding-top: 0.5em; }
ul.ledger.books .cover {
  display: block;
  width: 2.5rem;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #f4f4f4;
}
ul.ledger.books .cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
ul.ledger.books .typeset {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: linear-gradient(135deg, #f1f5f8, #e6eef4);
  color: #66737e;
  font-size: 1.05rem;
}
ul.ledger.books .what { padding-top: 0.15rem; line-height: 1.35; }
ul.ledger.books .what .note { margin-top: 0.2rem; }

@media (max-width: 600px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  nav.years { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* on a phone the month is a line of its own above the first book it holds */
@media (max-width: 540px) {
  ul.ledger.books > li { grid-template-columns: 1fr; }
  ul.ledger.books .when { padding: 0.35rem 0 0.5rem; }
  ul.ledger.books .when:empty { display: none; }
  .year-head { gap: 0.6rem; }
  .year-head .step { gap: 0; }
  .year-head .step a { padding: 0.8rem 0.5rem; }
  .year-head .step { margin-top: -0.8rem; margin-bottom: -0.8rem; margin-right: -0.5rem; }
}

/* ---------- faq ---------- */

.faq h3 { margin-top: 1.6rem; }
.faq h3:first-of-type { margin-top: 0; }

/* ---------- header / footer ---------- */

nav.crumb {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
}
nav.crumb a { text-decoration-color: var(--rule); }

footer {
  margin-top: 4.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--faded);
  font-size: 0.9rem;
}

footer p { margin: 0.3rem 0; }

/* ---------- archive article pages ---------- */

article.archived { margin-top: 1rem; }

article.archived h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
}

.archive-note {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faded);
  margin-bottom: 1rem;
}

article.archived img { max-width: 100%; height: auto; }
article.archived pre { overflow-x: auto; font-size: 0.85rem; padding: 0.75rem; border: 1px solid var(--rule); }
article.archived blockquote { margin: 1.2rem 0; padding-left: 1rem; border-left: 2px solid var(--accent-bright); color: var(--faded); }

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