/* ==========================================================================
   htbeyer.com

   Two typefaces, with a rule: Courier Prime is reserved for words Henry
   himself wrote or spoke. Source Serif 4 is the site's own voice. If it is
   in the typewriter face, he wrote it.
   ========================================================================== */

:root {
  --ink:        #1B2A3A;
  --ink-soft:   #33465a;
  --bone:       #F4EFE6;
  --bone-deep:  #e9e1d3;
  --onionskin:  #C8AE86;
  --brass:      #B8860B;
  --oxblood:    #6E2C2C;
  --paper:      #fbf8f3;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --rule: 1px solid rgba(27, 42, 58, 0.16);

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --typed: "Courier Prime", "Courier New", Courier, monospace;
}

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

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

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

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.68;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 48rem) {
  body { font-size: 1.125rem; }
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bone);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip:focus { left: 0; }

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

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.masthead {
  background: var(--ink);
  color: var(--bone);
  position: relative;
  z-index: 20;
}

.masthead__inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  padding: 0.85rem 0;
}

.wordmark__emblem {
  display: block;
  filter: invert(1) sepia(1) saturate(0.15) brightness(1.6);
}

.wordmark__text { display: flex; flex-direction: column; line-height: 1.15; }

.wordmark__name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.wordmark__dates {
  font-family: var(--typed);
  font-size: 0.72rem;
  color: var(--onionskin);
  letter-spacing: 0.04em;
}

.nav {
  display: flex;
  gap: clamp(0.85rem, 2.2vw, 1.75rem);
  align-items: center;
  flex-wrap: wrap;
}

.nav a {
  color: rgba(244, 239, 230, 0.82);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav a:hover { color: var(--bone); border-bottom-color: var(--onionskin); }

.nav a[aria-current="page"] {
  color: var(--bone);
  border-bottom-color: var(--brass);
}

.navtoggle { display: none; }

@media (max-width: 47.99rem) {
  .navtoggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid rgba(244, 239, 230, 0.32);
    color: var(--bone);
    font-family: var(--serif);
    font-size: 0.9375rem;
    padding: 0.45rem 0.8rem;
    cursor: pointer;
  }
  .navtoggle__bars,
  .navtoggle__bars::before,
  .navtoggle__bars::after {
    display: block;
    width: 15px;
    height: 1.5px;
    background: currentColor;
    content: "";
  }
  .navtoggle__bars { position: relative; }
  .navtoggle__bars::before { position: absolute; top: -5px; }
  .navtoggle__bars::after { position: absolute; top: 5px; }

  .nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-bottom: 0.75rem;
  }
  .nav.is-open { display: flex; }
  .nav a {
    width: 100%;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(244, 239, 230, 0.12);
  }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  z-index: -2;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom,
      rgba(27, 42, 58, 0.55) 0%,
      rgba(27, 42, 58, 0.30) 35%,
      rgba(27, 42, 58, 0.88) 100%);
}

.hero__inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(5rem, 22vh, 12rem) var(--gutter) clamp(2.5rem, 8vh, 4.5rem);
  color: var(--bone);
}

.hero__name {
  font-size: clamp(2.4rem, 7.5vw, 4.6rem);
  line-height: 1.02;
  font-weight: 400;
  margin: 0 0 0.4em;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.hero__dates {
  font-family: var(--typed);
  font-size: clamp(0.8rem, 1.6vw, 0.95rem);
  color: var(--onionskin);
  letter-spacing: 0.08em;
  margin: 0 0 1.6rem;
}

.hero__line {
  font-family: var(--typed);
  font-size: clamp(0.98rem, 2.1vw, 1.2rem);
  line-height: 1.72;
  max-width: 30rem;
  margin: 0;
  color: rgba(244, 239, 230, 0.94);
  border-left: 2px solid var(--brass);
  padding-left: 1.15rem;
}

.hero__attrib {
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
  color: rgba(244, 239, 230, 0.62);
  margin: 0.9rem 0 0 1.25rem;
}

.hero--short .hero__inner {
  padding-top: clamp(3rem, 12vh, 6rem);
  padding-bottom: clamp(2rem, 6vh, 3.5rem);
}

.hero--short .hero__name { font-size: clamp(1.9rem, 5vw, 3rem); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.main {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(2.75rem, 7vw, 5rem) var(--gutter) clamp(3.5rem, 9vw, 6rem);
}

.page--narrow .main { max-width: 48rem; }

.main > p,
.main > ul,
.main > ol,
.main > blockquote,
.main > h2,
.main > h3,
.main > h4,
.main > hr {
  max-width: var(--measure);
}

.main > h2 { max-width: 30rem; }

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 1rem; font-weight: 400; }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); margin: 3.2rem 0 0.9rem; }
h3 { font-size: 1.2rem; margin: 2.4rem 0 0.7rem; }
h4 { font-size: 1.03rem; margin: 1.8rem 0 0.5rem; }

.main > h2:first-child,
.main > h1:first-child { margin-top: 0; }

p { margin: 0 0 1.15em; }

a { color: var(--ink); text-decoration-color: var(--onionskin); text-underline-offset: 0.18em; }
a:hover { color: var(--oxblood); text-decoration-color: var(--oxblood); }

hr {
  border: 0;
  border-top: var(--rule);
  margin: 2.75rem 0;
}

blockquote {
  margin: 1.9rem 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--onionskin);
  font-style: italic;
  color: var(--ink-soft);
}

blockquote p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.3em; padding-left: 1.3em; }
li { margin-bottom: 0.4em; }

img { max-width: 100%; height: auto; display: block; }

code {
  font-family: var(--typed);
  font-size: 0.92em;
  background: var(--bone-deep);
  padding: 0.1em 0.35em;
}

/* --------------------------------------------------------------------------
   Blocks — ::: typed  is Henry's own words
   -------------------------------------------------------------------------- */

.block { margin: 2.4rem 0; }

.block--typed {
  font-family: var(--typed);
  font-size: 0.98rem;
  line-height: 1.85;
  background: var(--paper);
  border: var(--rule);
  border-left: 3px solid var(--brass);
  padding: clamp(1.4rem, 3.5vw, 2.2rem);
  max-width: 38rem;
  box-shadow: 0 1px 0 rgba(27, 42, 58, 0.04);
}

.block--typed p:last-child { margin-bottom: 0; }

.block--note {
  background: var(--bone-deep);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  max-width: var(--measure);
  font-size: 0.97rem;
}

.block--note p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Recordings
   -------------------------------------------------------------------------- */

.recording {
  border-top: var(--rule);
  padding: 2rem 0 2.2rem;
  max-width: 44rem;
}

.recording:first-of-type { border-top: 0; padding-top: 0.5rem; }

.recording__title {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.recording__meta {
  font-family: var(--typed);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin: 0 0 0.85rem;
}

.recording__desc { margin: 0 0 1rem; max-width: var(--measure); }

.recording__audio {
  width: 100%;
  height: 40px;
  margin-bottom: 0.7rem;
}

.recording__actions {
  font-size: 0.88rem;
  margin: 0;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.recording__size {
  font-family: var(--typed);
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.chapters { margin-top: 1.1rem; }

.chapters summary {
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding: 0.3rem 0;
}

.chapters summary:hover { color: var(--oxblood); }

.chapters__list {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  border-top: var(--rule);
}

.chapters__list li { margin: 0; border-bottom: var(--rule); }

.chapter {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  padding: 0.6rem 0.4rem;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink);
  transition: background 0.12s ease;
}

.chapter:hover { background: var(--bone-deep); }

.chapter[aria-current="true"] {
  background: var(--bone-deep);
  box-shadow: inset 2px 0 0 var(--brass);
}

.chapter__time {
  font-family: var(--typed);
  font-size: 0.8rem;
  color: var(--ink-soft);
  min-width: 3.6rem;
  flex-shrink: 0;
}

.chapter__flag {
  font-family: var(--typed);
  font-size: 0.68rem;
  color: var(--oxblood);
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Documents
   -------------------------------------------------------------------------- */

.docgroup { margin: 0 0 3rem; }

.docgroup__title {
  font-size: 1.05rem;
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
  max-width: 44rem;
  font-weight: 600;
}

.docs { list-style: none; margin: 0; padding: 0; max-width: 44rem; }

.doc { border-bottom: var(--rule); }

.doc__link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.8rem 0.4rem;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.12s ease, padding-left 0.12s ease;
}

.doc__link:hover {
  background: var(--bone-deep);
  padding-left: 0.7rem;
  color: var(--ink);
}

.doc__title { font-size: 1rem; }

.doc__meta {
  font-family: var(--typed);
  font-size: 0.76rem;
  color: var(--ink-soft);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Home: full-bleed dark sections
   -------------------------------------------------------------------------- */

.band {
  background: var(--ink);
  color: var(--bone);
  margin: clamp(3rem, 8vw, 5rem) calc(50% - 50vw);
  padding: clamp(2.75rem, 8vw, 4.5rem) calc(50vw - 50% + var(--gutter));
}

.band h2 { color: var(--bone); margin-top: 0; }
.band p { color: rgba(244, 239, 230, 0.86); max-width: var(--measure); }
.band a { color: var(--bone); text-decoration-color: var(--brass); }
.band a:hover { color: var(--onionskin); text-decoration-color: var(--onionskin); }

.band .block--typed {
  background: rgba(244, 239, 230, 0.05);
  border-color: rgba(244, 239, 230, 0.18);
  border-left-color: var(--brass);
  color: var(--bone);
  box-shadow: none;
}

.cards {
  display: grid;
  gap: 1px;
  background: rgba(27, 42, 58, 0.16);
  border: var(--rule);
  margin: 2.5rem 0;
  max-width: 60rem;
}

@media (min-width: 40rem) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--bone);
  padding: clamp(1.3rem, 3.5vw, 1.9rem);
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: background 0.15s ease;
}

.card:hover { background: var(--paper); color: var(--ink); }

.card__title { font-size: 1.1rem; font-weight: 600; }

.card__desc {
  font-size: 0.94rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

.card__count {
  font-family: var(--typed);
  font-size: 0.74rem;
  color: var(--brass);
  letter-spacing: 0.05em;
  margin-top: auto;
  padding-top: 0.6rem;
}

.lede {
  font-size: clamp(1.12rem, 2.4vw, 1.32rem);
  line-height: 1.6;
  max-width: 32rem;
  color: var(--ink-soft);
}

.figure { margin: 2.75rem 0; max-width: 60rem; }

.figure img { width: 100%; }

.figure__caption {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin: 0.7rem 0 0;
  max-width: 30rem;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  background: var(--ink);
  color: rgba(244, 239, 230, 0.78);
  padding: clamp(2.5rem, 7vw, 4rem) 0;
  margin-top: auto;
}

.footer__inner {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.footer__line { max-width: 32rem; margin: 0 0 1.2rem; }

.footer__maintainer { margin: 0 0 1.6rem; font-size: 0.95rem; }

.footer a { color: var(--bone); text-decoration-color: var(--brass); }
.footer a:hover { color: var(--onionskin); }

.footer__legal {
  font-family: var(--typed);
  font-size: 0.74rem;
  color: rgba(244, 239, 230, 0.42);
  margin: 0;
  letter-spacing: 0.03em;
}

@media print {
  .masthead, .nav, .footer, .hero__img, .chapters { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .band { background: none; color: #000; margin: 0; padding: 0; }
}
