/* Academy of the Impossible — paper, ink, meadow.
   No webfonts on principle: character comes from scale and spacing,
   and the whole site loads on a bad rural connection. */

:root {
  --paper: #fbfaf5;
  --ink: #26251f;
  --meadow: #2e5339;   /* links, marks */
  --hay: #6e7d2e;      /* visited, small accents */
  --faint: #8a8778;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #201f1b;
    --ink: #e8e6dc;
    --meadow: #8fbf9c;
    --hay: #a0b460;
    --faint: #96937f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  max-width: var(--measure);
  background: var(--paper);
  color: var(--ink);
  font-family: 'Iowan Old Style', 'Palatino Linotype', Palatino,
               Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: var(--meadow); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:visited { color: var(--hay); }
a:focus-visible { outline: 2px solid var(--meadow); outline-offset: 2px; }

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 700;
}
h1 { font-size: 1.9rem; margin: 2.2rem 0 0.8rem; }
.hero-title {
  font-family: Futura, 'Century Gothic', 'Avant Garde', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.02em;
}
h2 { font-size: 1.3rem; margin: 2rem 0 0.6rem; }

/* Header: quiet, name + rooms */
.site-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  align-items: baseline;
  border-bottom: 1px solid var(--faint);
  padding-bottom: 0.9rem;
}
.site-name {
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.site-head nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-head nav a { color: var(--ink); text-decoration: none; }
.site-head nav a:hover { color: var(--meadow); text-decoration: underline; }

/* The signature: thesis as hero, set large against a meadow waymark */
.thesis { margin: 3rem 0 2.5rem; }
.thesis-text,
.thesis p {
  font-family: Futura, 'Century Gothic', 'Avant Garde', sans-serif;
  font-size: 1.7rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  margin: 0;
}
.thesis-note { color: var(--faint); font-size: 0.85rem; padding-left: 1.35rem; }

/* Signpost: the rooms */
.rooms { list-style: none; padding: 0; margin: 1.5rem 0; }
.rooms li { padding: 0.45rem 0; border-bottom: 1px dashed color-mix(in srgb, var(--faint) 45%, transparent); }
.rooms a { font-weight: 700; }
.rooms span { color: var(--faint); }

/* Post lists */
.post-list { list-style: none; padding: 0; }
.post-list li { padding: 0.35rem 0; }
.post-list time { color: var(--faint); font-size: 0.85rem; margin-left: 0.5rem; }

.post-meta, .section-intro { color: var(--faint); }
.post-foot { border-top: 1px solid var(--faint); margin-top: 3rem; padding-top: 1rem; font-size: 0.9rem; color: var(--faint); }

.banner { width: 100%; height: auto; margin: 2rem 0; }
.e-content img { max-width: 100%; height: auto; }
blockquote {
  margin: 1.2rem 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--hay);
  color: color-mix(in srgb, var(--ink) 85%, var(--faint));
}
pre { overflow-x: auto; padding: 0.8rem; background: color-mix(in srgb, var(--ink) 6%, var(--paper)); }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.9em; }

/* Photo gallery — thumbnail grid, click for full */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.gallery figure {
  margin: 0;
}
.gallery img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 2px;
}
.gallery figcaption {
  font-size: 0.8rem;
  color: var(--faint);
  margin-top: 0.25rem;
}

.site-foot {
  margin-top: 4rem;
  border-top: 1px solid var(--faint);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: var(--faint);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  a { transition: color 120ms ease; }
}

/* Images and captions inside essays and pages */
main img { max-width: 100%; height: auto; }
main figure { margin: 1.5rem 0; }
main figure img { display: block; margin: 0 auto; }
main figcaption { font-size: 0.85rem; color: var(--faint); margin-top: 0.4rem; text-align: center; }


.photo-pair {
  display: flex;
  gap: 0.75rem;
}
.photo-pair img {
  width: 50%;
  max-width: 360px;
  height: auto;
}

/* Dictionary entry: what we mean by literacy */
.definition {
  margin: 0 0 2.5rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--ink);
  background: color-mix(in srgb, var(--ink) 4%, var(--paper));
  font-family: Futura, 'Century Gothic', 'Avant Garde', sans-serif;
  font-size: 0.85rem;
  line-height: 1.45;
}
.definition p, .definition ol { margin: 0 0 0.5rem; }
.definition .headword { font-size: 1.15rem; }
.definition ol { padding-left: 1.25rem; }
.definition .source { color: var(--faint); font-size: 0.85em; }
.definition .usage { margin-top: 0.75rem; font-style: italic; }
.definition .usage .source { font-style: normal; margin-left: 0.4em; }

/* Closing quote, bookending the hero */
blockquote.closing {
  margin: 3.5rem 0 1rem;
  padding: 0;
  border-top: none;
  border-left: none;
  padding-left: 0;
}
blockquote.closing p { margin: 0 0 0.5rem; }
blockquote.closing em {
  font-family: Futura, 'Century Gothic', 'Avant Garde', sans-serif;
  font-style: normal;
  font-size: 1.15em;
  letter-spacing: 0.02em;
}
blockquote.closing footer { color: var(--faint); font-size: 0.9rem; }
blockquote.closing footer::before { content: "— "; }

/* About: row of old Academy photos, stacks on phones */
.photo-row { margin: 2rem 0; }
.photo-row .photos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}
@media (min-width: 500px) {
  .photo-row .photos { grid-template-columns: repeat(3, 1fr); }
}
.photo-row img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}
.photo-row figcaption, .portrait figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--faint);
}

/* About: portrait beside the bio on wide screens */
.portrait { margin: 1.5rem auto; max-width: 280px; }
.portrait img { width: 100%; display: block; }
@media (min-width: 640px) {
  .portrait { float: right; margin: 0.25rem 0 1rem 1.5rem; width: 40%; }
}
.portrait + p + h2, h2 { clear: both; }

/* Woodcut emblems: one ink, flipped to light ink in dark mode */
.emblem { display: block; width: 240px; max-width: 70%; height: auto; margin: 1.5rem 0 0.25rem; }
.rooms li { display: flex; align-items: center; gap: 0.9rem; }
.room-emblem { width: 96px; height: auto; flex: none; }
.ornament { display: block; width: 280px; max-width: 80%; height: auto; margin: 0 auto 1.25rem; }
@media (prefers-color-scheme: dark) {
  .emblem, .room-emblem, .ornament { filter: invert(1); }
}
