@font-face {
  font-family: "Gravitas One";
  src: url("/fonts/gravitas-one-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Old Standard TT";
  src: url("/fonts/old-standard-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Old Standard TT";
  src: url("/fonts/old-standard-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Old Standard TT";
  src: url("/fonts/old-standard-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --locomotive: #12352b;
  --firebox: #0b1f19;
  --brass: #e2bf6e;
  --copper: #8a4f24;
  --oxblood: #7d221d;
  --paper: #f0e6cd;
  --ink: #1f1a12;
  --display: "Gravitas One", "Bodoni 72", Didot, Georgia, serif;
  --body: "Old Standard TT", "Hoefler Text", Georgia, "Times New Roman", serif;
  --gutter: clamp(1rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.3125rem/1.55 var(--body);
}

a { color: inherit; text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--oxblood); outline-offset: 3px; }

h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; }

/* Hero: a lined, riveted locomotive panel */
.hero {
  background: var(--locomotive);
  color: var(--paper);
  padding: var(--gutter);
}
.hero :focus-visible { outline-color: var(--brass); }
.plate {
  position: relative;
  border: 3px solid var(--brass);
  outline: 1px solid var(--brass);
  outline-offset: -10px;
  padding: clamp(2rem, 4vw, 3.25rem) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
}
.rivet {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brass);
  border: 3px solid var(--firebox);
  box-shadow: inset -2px -2px 0 var(--copper);
}
.tl { top: -3px; left: -3px; }
.tr { top: -3px; right: -3px; }
.bl { bottom: -3px; left: -3px; }
.br { bottom: -3px; right: -3px; }

.mark {
  display: block;
  margin: 0 auto;
  width: min(100%, clamp(15rem, 33vw, 27rem));
  height: auto;
  overflow: visible;
}
.wordmark {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  font-size: 7vw;
  line-height: 1.02;
  text-wrap: balance;
  color: var(--brass);
  text-shadow: 0.035em 0.035em 0 var(--copper);
}
.lede {
  margin: 0 auto;
  max-width: 34ch;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-style: italic;
  line-height: 1.25;
  text-wrap: balance;
}

/* Divider: a cog on a line */
.rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 26rem;
  margin: clamp(1rem, 2.5vw, 1.5rem) auto;
  color: var(--brass);
}
.rule::before, .rule::after {
  content: "";
  flex: 1;
  border-top: 3px double currentColor;
}
.rule svg { width: 1.75rem; height: 1.75rem; fill: currentColor; }

/* The hat tip: the gears turn and lift it, once on load and again on hover */
.gear, .hat { animation: 1.7s cubic-bezier(0.45, 0, 0.25, 1) 0.6s 1 both; }
.gear { transform-origin: 0 0; animation-name: turn; }
.g1 { --turn: 70deg; }
.g2 { --turn: -140deg; }
.g3 { --turn: 89.090deg; }
.hat {
  transform-box: fill-box;
  transform-origin: 15% 100%;
  animation-name: tip;
}
.mark:hover .gear { animation-name: turn-again; animation-delay: 0s; }
.mark:hover .hat { animation-name: tip-again; animation-delay: 0s; }
@keyframes turn { 0%, 100% { transform: none; } 38%, 62% { transform: rotate(var(--turn)); } }
@keyframes turn-again { 0%, 100% { transform: none; } 38%, 62% { transform: rotate(var(--turn)); } }
@keyframes tip { 0%, 100% { transform: none; } 38%, 62% { transform: translateY(-26px) rotate(-15deg); } }
@keyframes tip-again { 0%, 100% { transform: none; } 38%, 62% { transform: translateY(-26px) rotate(-15deg); } }
@media (prefers-reduced-motion: reduce) {
  .gear, .hat, .mark:hover .gear, .mark:hover .hat { animation: none; }
}

/* Ledger: the reading part of the page */
.ledger {
  padding: clamp(3rem, 7vw, 5rem) var(--gutter);
  display: grid;
  gap: clamp(2.75rem, 6vw, 4rem);
}
.entry {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  text-align: center;
}
.entry.wide { max-width: 68rem; }
.entry h2 {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  line-height: 1.15;
  color: var(--locomotive);
  margin-bottom: 0.75rem;
}
.entry p { margin: 0; text-wrap: pretty; }

.figures {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.figures li {
  padding: 0 clamp(1rem, 3vw, 2.25rem);
  border-left: 1px solid var(--ink);
}
.figures li:first-child { border-left: 0; }

/* The return pipe: Learn feeds back into Build */
.return-pipe {
  position: relative;
  height: 2.25rem;
  margin: 1.75rem calc(100% / 6) 0;
  border: 4px double var(--ink);
  border-top: 0;
  border-radius: 0 0 1.25rem 1.25rem;
}
.return-pipe::before {
  content: "";
  position: absolute;
  top: -0.75rem;
  left: -4px;
  width: 0;
  height: 0;
  margin-left: calc(2px - 0.5rem);
  border: 0.5rem solid transparent;
  border-top: 0;
  border-bottom: 0.75rem solid var(--ink);
}
.figures svg {
  display: block;
  width: 8rem;
  height: 8rem;
  margin: 0 auto 0.5rem;
  color: var(--ink);
}
.figures .caption { font-style: italic; color: var(--oxblood); }
.figures h3 {
  margin: 0 0 0.25rem;
  font: 400 1.5rem/1.2 var(--display);
  color: var(--locomotive);
}

/* Footer */
.footer {
  background: var(--locomotive);
  color: var(--paper);
  border-top: 3px solid var(--brass);
  padding: 1.5rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  justify-content: space-between;
  font-size: 1.125rem;
}
.footer p { margin: 0; }
.footer :focus-visible { outline-color: var(--brass); }

/* Inner pages */
.topbar {
  background: var(--locomotive);
  border-bottom: 3px solid var(--brass);
  padding: 1.125rem var(--gutter);
}
.topbar a {
  font: 400 1.5rem/1.2 var(--display);
  color: var(--brass);
  text-decoration: none;
}
.topbar :focus-visible { outline-color: var(--brass); }
.prose {
  padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter);
  max-width: calc(40rem + 2 * var(--gutter));
  margin: 0 auto;
}
.prose h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.1;
  color: var(--locomotive);
}
.prose h2 {
  font-size: 1.5rem;
  line-height: 1.2;
  margin-top: 2.25rem;
  color: var(--locomotive);
}
.prose p, .prose ul { margin: 0.75rem 0 0; }
.prose .updated { font-style: italic; }

@media (max-width: 760px) {
  .wordmark { font-size: 14vw; }
  .figures { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .figures li { border-left: 0; padding: 0; }
  .return-pipe { display: none; }
}
