/* Richard Metzner — one quiet stylesheet for the whole site. */

@font-face {
  font-family: "Goudy";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/sorts-mill-goudy-latin-400-normal.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: "Goudy";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/sorts-mill-goudy-latin-ext-400-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Goudy";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/sorts-mill-goudy-latin-400-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: "Goudy";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/sorts-mill-goudy-latin-ext-400-italic.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Courier Prime";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/courier-prime-latin-400-normal.woff2") format("woff2");
}

:root {
  --paper: #faf9f5;
  --ink: #1f1e1d;
  --muted: #6e6d67;
  --faint: #a3a198;
  --rule: #e6e4dc;
  --serif: "Goudy", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--faint);
  text-underline-offset: 0.22em;
  transition: text-decoration-color 0.2s ease;
}
a:hover { text-decoration-color: currentColor; }
a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

::selection { background: #1f1e1d; color: #faf9f5; }

.dots {
  margin: 0;
  color: var(--faint);
  letter-spacing: 0.4em;
  line-height: 1;
}

.caps {
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

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

/* ───────────── Home ───────────── */

.home {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
}

.home main { overflow: clip; } /* keeps the eagle's flight path from widening the page */

/* First screen: only the name, the motto and the eagle. */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2.25rem;
  padding: 0 16px;
  text-align: center;
}

/* A faint hint that there is more below. */
.more-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 8px 12px;
  color: var(--faint);
  letter-spacing: 0.4em;
  margin-right: -0.4em;
  line-height: 1;
  text-decoration: none;
  animation: hint 1.6s 2.2s ease-out both;
  transition: color 0.2s ease;
}
.more-hint:hover { color: var(--muted); }
@keyframes hint {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Everything else waits below and fades in as you scroll to it. */
.more {
  min-height: 88vh;
  min-height: 88svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 2.6rem;
  padding: 10vh 16px 8vh;
  text-align: center;
}

.name {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.6rem, 10.5vw, 6.25rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  animation: rise 1.2s ease-out both;
}
.name .keep { white-space: nowrap; }

.motto {
  margin: -0.75rem 0 0;
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  color: var(--ink);
  animation: rise 1.2s 0.25s ease-out both;
}

/* Books, Film, Software: small centred "shelves". */
.shelf {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
}
.shelf h2 {
  margin: 0 0 0.35rem;
  font-weight: 400;
  color: var(--muted);
}
.shelf ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}
.shelf .soon { color: var(--muted); }
.shelf .soon em { font-size: 0.85em; }
.shelf .film { line-height: 1.35; }

/* js/reveal.js adds .reveal to <html>; without JS the shelves are simply there. */
.reveal .shelf {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}
.reveal .shelf.shown { opacity: 1; transform: none; }
.reveal .shelf.shown + .shelf.shown { transition-delay: 0.15s; }
.reveal .shelf.shown + .shelf.shown + .shelf.shown { transition-delay: 0.3s; }

.foot {
  padding: 0 16px 28px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* The eagle. js/eagle.js animates it; without JS (or with reduced motion) the still drawing stays. */

.eagle {
  position: relative;
  display: inline-block;
  height: 0.74em;
  aspect-ratio: 92 / 58.5;
  margin-left: 0.2em;
  vertical-align: -0.01em;
  color: var(--ink);
}
.eagle svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: currentColor;
}
.eagle.live .still { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .name, .motto, .more-hint { animation: none; }
}

/* ───────────── Book reader ───────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 14px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.bar a { text-decoration: none; }
.bar a:hover { text-decoration: underline; text-decoration-color: var(--faint); }
.bar .home-link { font-size: 1rem; color: var(--muted); }

.reader {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 16px;
}

.cover {
  min-height: 78vh;
  min-height: 78svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.75rem;
  text-align: center;
}
.cover h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(2.4rem, 9vw, 4.6rem);
  line-height: 1.2;
  letter-spacing: 0.34em;
  margin-right: -0.34em; /* optically re-centre the tracked caps */
  text-transform: uppercase;
}
.cover .by { margin: 0; font-size: 1.05rem; color: var(--muted); }

.index {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.9rem 0.5rem;
  margin: 0 0 12vh;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.9rem;
  text-align: center;
}
.index a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.index a:hover, .index a:focus-visible { color: var(--ink); }

.poem {
  padding: 13vh 0;
  scroll-margin-top: 3rem;
}
.poem .num {
  margin: 0 0 0.6rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--muted);
}
.poem h2 {
  margin: 0 0 1.4rem;
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.25;
}
.poem p:not(.num) {
  margin: 0 0 1.2em;
  line-height: 1.6;
}
.poem .l {
  display: block;
  padding-left: 1em;
  text-indent: -1em; /* a verse that wraps on a narrow screen hangs under itself */
}

.coda {
  display: grid;
  justify-items: center;
  gap: 1.75rem;
  padding: 22vh 0 18vh;
  text-align: center;
}
.coda p { margin: 0; }
.coda .last { font-style: italic; font-size: 1.45rem; }
.coda .rights { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 480px) {
  body { font-size: 1.15rem; }
  .index { grid-template-columns: repeat(5, 1fr); }
  .poem h2 { font-size: 1.45rem; }
}

/* ───────────── Project pages ───────────── */

.intro {
  display: grid;
  justify-items: center;
  gap: 1.6rem;
  padding: 16vh 0 11vh;
  text-align: center;
}
.intro h1 { margin: 0; line-height: 0; }
.intro h1 img { width: min(280px, 72vw); height: auto; }
.lede {
  margin: 0;
  max-width: 24em;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.4;
}

.part { padding: 0 0 3.2rem; }
.part h2 {
  margin: 0 0 1rem;
  font-weight: 400;
  color: var(--muted);
}
.part p { margin: 0 0 1em; line-height: 1.6; }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  margin: 0 0 0.9em;
  padding-left: 2.6rem;
  line-height: 1.6;
  counter-increment: step;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.32em;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
}
.steps strong { font-weight: 400; font-style: italic; }

.quote {
  margin: 1rem 0 4.2rem;
  padding: 0;
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.4;
  text-align: center;
}

.shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 0 3.2rem;
}
.shots img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.shots figcaption {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.project .coda { padding: 8vh 0 14vh; }

@media (max-width: 480px) {
  .lede { font-size: 1.25rem; }
  .quote { font-size: 1.3rem; }
  .shots { grid-template-columns: 1fr; }
}

/* ───────────── 404 ───────────── */

.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1.5rem;
  padding: 0 16px;
  text-align: center;
}
.lost h1 { margin: 0; font-weight: 400; font-size: 2rem; }
