:root {
  --paper: #f7f5f1;
  --ink: #1c1917;
  --muted: #5e584f;
  --line: #e4dfd6;
  --rule: #d9d3c8;
  --display: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  --t12: 12px;
  --t16: 16px;
  --t21: 21px;
  --t28: 28px;
  --t38: 38px;
  --t51: 51px;
  --t67: 67px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--t21);
  line-height: 1.55;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
ul { list-style: none; }
a { color: inherit; }
h1, h2, h3 {
  font-weight: 500;
  text-wrap: balance;
  hyphens: manual;
}
p { text-wrap: pretty; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection { background: #e6dfd4; color: var(--ink); }

.skip {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 5;
  padding: 8px 16px;
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

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

.wrap {
  width: min(1200px, calc(100% - 96px));
  margin-inline: auto;
}

.hero {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  column-gap: 80px;
  align-items: center;
  padding: 80px 0;
}

.hero-copy { max-width: 640px; }

.hi {
  font-size: var(--t16);
  font-style: italic;
  color: var(--muted);
  margin-bottom: 16px;
}

h1 {
  font-size: var(--t67);
  line-height: 0.98;
  letter-spacing: -0.03em;
  max-width: 680px;
}

.lede {
  margin-top: 24px;
  max-width: 36rem;
  font-size: var(--t21);
  line-height: 1.5;
}
.mission {
  font-style: italic;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 32px;
}
.nav a,
.links a,
.back a,
.block h2 a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: #8f877c;
  transition: text-decoration-color 300ms var(--ease), color 300ms var(--ease), transform 300ms var(--ease);
}
.nav a:hover,
.links a:hover,
.back a:hover,
.block h2 a:hover,
.catalog a:hover {
  text-decoration-color: currentColor;
}
.nav a:active,
.links a:active,
.back a:active,
.catalog a:active,
.block h2 a:active { transform: scale(0.98); }
.nav a[aria-current="page"] { text-decoration-color: currentColor; }

.frame-wrap {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 3 / 4;
  margin-left: auto;
}
.hero .frame-wrap { animation: rise 500ms var(--ease) both; }
.frame {
  width: 100%;
  height: 100%;
  clip-path: polygon(
    22% 0, 78% 0,
    100% 14%, 100% 86%,
    78% 100%, 22% 100%,
    0 86%, 0 14%
  );
  background: #efece6;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}
.oct-stroke {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--ink);
  pointer-events: none;
}

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

.rest { padding-bottom: 48px; }

.block {
  padding-top: 64px;
  padding-bottom: 80px;
  border-top: 1px solid var(--line);
}
.block h2 {
  font-size: var(--t28);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 680px;
  margin-bottom: 24px;
}
.block h2 a { color: inherit; }

.measure { max-width: 65ch; }
.measure p + p,
.essay-body p + p { margin-top: 16px; }

.note {
  color: var(--muted);
  margin-bottom: 24px;
  max-width: 65ch;
  font-size: var(--t16);
}

.theorem,
.formula {
  font-size: var(--t28);
  font-style: italic;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 680px;
}
.theorem { margin-bottom: 0; }
.formula { margin-bottom: 24px; }

.entries { max-width: 720px; }
.entry {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 8px 24px;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.label {
  font-size: var(--t12);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.lead { font-weight: 600; }

.catalog { max-width: 65ch; }
.catalog a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: color 300ms var(--ease), transform 300ms var(--ease);
}
.catalog li:last-child a { border-bottom: 1px solid var(--line); }
.catalog .title { font-size: var(--t21); line-height: 1.35; }
.catalog a:hover .title { text-decoration: underline; text-underline-offset: 3px; }
.year {
  font-size: var(--t12);
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}

.links { margin-top: 8px; max-width: 65ch; }
.links a { display: inline-block; padding: 12px 0; }
.links li + li { border-top: 1px solid var(--line); }

.colophon {
  padding: 32px 0 96px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--t16);
}
.colophon .fine {
  font-size: var(--t12);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.colophon .last-updated {
  margin-top: 8px;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: baseline;
}

.page-head { padding: 80px 0 48px; }
.page-head h1 {
  font-size: var(--t67);
  margin-top: 24px;
}
.deck {
  margin-top: 16px;
  max-width: 65ch;
  font-style: italic;
  color: var(--muted);
}
.back { font-size: var(--t16); }

.essay { border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.essay:last-of-type { border-bottom: 1px solid var(--line); }
.essay summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: baseline;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
}
.essay summary::-webkit-details-marker { display: none; }
.essay summary:active { transform: scale(0.98); }
.essay-title {
  font-size: var(--t21);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-align: left;
}
.essay-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: var(--t12);
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.twist {
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 300ms var(--ease);
}
details[open] .twist { transform: rotate(-135deg) translateY(-1px); }
.essay-body {
  max-width: 65ch;
  padding-bottom: 32px;
  font-size: var(--t21);
}
.essay-body strong { font-weight: 600; }
.pull {
  font-style: italic;
  font-weight: 500;
  font-size: var(--t28);
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin-top: 24px;
  margin-bottom: 24px;
}
.pull strong { font-weight: 500; }

@media (max-width: 800px) {
  .wrap { width: min(1200px, calc(100% - 40px)); }
  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    row-gap: 40px;
    padding: 48px 0 64px;
  }
  h1, .page-head h1 { font-size: var(--t51); }
  .hero .frame-wrap { width: min(100%, 420px); margin-inline: auto; }
  .block h2, .theorem, .formula { font-size: var(--t21); }
  .entry { grid-template-columns: 1fr; gap: 4px; }
  .page-head { padding-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
