/* Dodona Research. A fixed bar, one reading column, and nothing else. */

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-italic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: block;
}

:root {
  color-scheme: light; /* white with black text, whatever the system is set to */
  --bg: #ffffff;
  --fg: #111111;
  --fg-soft: #3a3a3a;
  --fg-faint: #7a7a7a;
  --rule: #ececec;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bar: 54px;
  --column: 660px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 1rem); }

body {
  margin: 0;
  padding-top: var(--bar);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  font-variant-numeric: proportional-nums lining-nums;
}

a { color: inherit; text-decoration-color: color-mix(in srgb, var(--fg) 30%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

/* ---------- the bar: oak and name on the left, links on the right ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--bar);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--bg);
  font-family: var(--sans);
}

/* The oak sits dead centre of the bar; the links keep to the right. */
.brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  line-height: 0;
}
.brand img { height: 33px; width: auto; display: block; }

/* Under the pointer the oak rises out of the bar and the name comes up from
   beneath to take its place. The clip trims top and bottom only, so the name
   can be wider than the oak. */
.brand { clip-path: inset(-4px -50vw); }
.brand img, .brand-name { transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s ease; }
.brand-name {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 120%);
  opacity: 0;
  font-family: var(--display);
  font-size: 23px;
  line-height: 1;
  white-space: nowrap;
  color: var(--fg);
}
@media (hover: hover) {
  .brand:hover img, .brand:focus-visible img { transform: translateY(-120%); opacity: 0; }
  .brand:hover .brand-name, .brand:focus-visible .brand-name { transform: translate(-50%, -50%); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .brand img, .brand-name { transition: none; } }

.bar nav { display: flex; align-items: center; gap: 1.75rem; }
.bar nav a {
  color: var(--fg);
  font-size: 15px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.bar nav a:hover { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--fg) 20%, transparent); }

/* ---------- the homepage title ---------- */

.title {
  margin: 0;
  padding: 2.25rem var(--pad) 2.5rem;
  text-align: center;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3.2rem, 10vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- the column ---------- */

main {
  max-width: calc(var(--column) + 2 * var(--pad));
  margin: 0 auto;
  padding: 1rem var(--pad) 0;
}

.prose p { margin: 0 0 1.8rem; }
.prose h2, .prose h3 {
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.4;
}
.prose h2 { font-family: var(--sans); font-weight: 500; font-size: 1.3rem; letter-spacing: -0.012em; line-height: 1.3; margin: 3rem 0 1.1rem; text-wrap: balance; }
.prose h3 { font-size: 1.2rem; margin: 2.5rem 0 0.8rem; }
.prose ul, .prose ol { margin: 0 0 1.8rem; padding-left: 1.3rem; }
.prose li { margin-bottom: 0.5rem; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.8rem 0; }
.prose blockquote { margin: 0 0 1.8rem; padding-left: 1.1rem; border-left: 2px solid var(--rule); color: var(--fg-soft); }
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
.prose pre { overflow-x: auto; padding: 1rem; margin: 0 0 1.8rem; background: color-mix(in srgb, var(--fg) 4%, transparent); font-size: 14px; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }

/* ---------- a piece of writing ---------- */

.piece-head { text-align: center; margin: 1.5rem auto 2.5rem; max-width: 480px; }
.piece-head h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.4; text-wrap: balance; }
.piece-head .meta { margin: 0.75rem 0 0; }

.meta, .draft { font-family: var(--sans); font-size: 15px; color: var(--fg-faint); }
.draft { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; background: color-mix(in srgb, var(--fg) 5%, transparent); border-radius: 100px; padding: 0.35em 0.8em; vertical-align: 0.15em; }

/* ---------- page and listing headings ---------- */

.page-head { margin: 1.5rem 0 2.5rem; }
.page-head h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 2.6rem; line-height: 1.1; text-wrap: balance; }
/* A page with a headline of its own: set very large, with nothing above it. */
.page-head.big { margin: clamp(2rem, 6vw, 4.5rem) 0 clamp(2.4rem, 6vw, 4.2rem); }
.page-head.big h1 { font-size: clamp(3.2rem, 11.5vw, 7.2rem); line-height: 0.98; letter-spacing: -0.015em; }
@media (min-width: 1000px) { .page-head.big { margin-left: -48px; margin-right: -120px; } }
.strapline { margin: 0.25rem 0 0; font-family: var(--sans); font-size: 15px; color: var(--fg-faint); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; margin-bottom: 1.1rem; }
.list a { text-decoration: none; }
.list a:hover { text-decoration: underline; }
.list .by { display: block; font-family: var(--sans); font-size: 15px; color: var(--fg-faint); }
.list time { flex-shrink: 0; font-family: var(--sans); font-size: 15px; color: var(--fg-faint); }

.empty { font-family: var(--sans); font-size: 15px; color: var(--fg-faint); }

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

.foot {
  max-width: calc(952px + 2 * var(--pad));
  margin: 9rem auto 0;
  padding: 0 var(--pad) 0;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--fg-faint);
}
.foot::before { content: ""; display: block; height: 1px; background: var(--rule); margin-bottom: 2rem; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 2rem; }
.foot h4 { margin: 0 0 0.5rem; font-weight: 400; color: var(--fg-faint); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.5rem; }
.foot a { color: var(--fg); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .legal { margin: 3rem 0 0; }
/* The painting runs the full width of the window and ends the page. On very
   wide screens its height is capped and the extra comes off the grass. */
.foot-art { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; object-position: center top; margin: 2.5rem 0 0; }

/* On a phone the links drop to a second row under the oak. */
@media (max-width: 700px) {
  :root { --bar: 88px; }
  .bar { flex-direction: column; justify-content: flex-end; padding: 0 1rem 0.6rem; }
  .brand { top: 0.5rem; transform: translateX(-50%); }
  .brand img { height: 30px; }
  .bar nav { gap: 1rem; }
  .bar nav a { font-size: 13.5px; }
  .list li { flex-direction: column; gap: 0.1rem; }
}

/* ---------- figures ---------- */

.prose figure { margin: 2.6rem 0 2.8rem; }
.prose figure svg { display: block; width: 100%; height: auto; }
.prose figure svg text { font-family: var(--sans); }
.prose figcaption { margin-top: 1.1rem; font-family: var(--sans); font-size: 13px; line-height: 1.55; color: var(--fg-faint); }

/* ---------- section headings in the margin ---------- */

/* On a wide screen each section heading sits to the left of the text it
   introduces, level with its first line. (.blk is the editing preview's
   wrapper around each block.) */
@media (min-width: 1240px) {
  .prose {
    display: grid;
    grid-template-columns: 210px minmax(0, var(--column));
    column-gap: 44px;
    align-items: start;
    margin-left: -254px;
  }
  .prose > * { grid-column: 2; min-width: 0; }
  .prose > h2, .prose > .blk:has(> h2) { grid-column: 1; }
  .prose > .page-head.big { grid-column: 1 / -1; margin-left: 206px; margin-right: -120px; }
  .prose h2 { font-size: 1.02rem; line-height: 1.4; margin: 1.9rem 0 0; text-align: right; }
  .prose > h2 + *, .prose > .blk:has(> h2) + * { margin-top: 1.55rem; }
  .prose h3 { margin-top: 0.8rem; }
}
