/* ==========================================================================
   TMCrowder.com
   Shared stylesheet for all four pages.
   Colors, type sizes and spacing all come from the tokens in :root below,
   so changing a value there changes it everywhere.
   ========================================================================== */

:root {
  /* Palette */
  --ink:        #14202e;  /* body text, near black with a blue cast */
  --ink-soft:   #4a5666;  /* secondary text */
  --faded:      #6c6a63;  /* metadata, captions */
  --paper:      #e9e7e0;  /* page ground */
  --vellum:     #f5f3ec;  /* the excerpt sheet */
  --verdigris:  #3f6b5e;  /* accent: links, drop cap, rules */
  --verdigris-d:#2c4c42;  /* accent, hover */
  --brass:      #9a7b3f;  /* used once, on the placeholder notice */
  --hairline:   rgba(20, 32, 46, 0.16);

  /* Type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Spectral", Georgia, "Times New Roman", serif;

  /* Rhythm */
  --measure: 34rem;       /* reading width */
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --rule-space: 2.75rem;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.0325rem, 0.98rem + 0.25vw, 1.125rem);
  font-weight: 400;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a {
  color: var(--verdigris);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--verdigris-d); }

a:focus-visible {
  outline: 2px solid var(--verdigris);
  outline-offset: 3px;
  border-radius: 2px;
}

p { margin: 0 0 1.15em; }

/* Small letterspaced labels. Used for eyebrows and running heads. */
.label {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faded);
}

/* --------------------------------------------------------------------------
   Masthead and navigation
   -------------------------------------------------------------------------- */

.masthead {
  border-bottom: 1px solid var(--hairline);
}

.masthead .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.35rem;
  padding-bottom: 1.35rem;
}

.masthead-name {
  font-family: var(--display);
  font-variation-settings: "SOFT" 10, "WONK" 1, "opsz" 32;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.masthead-name:hover { color: var(--verdigris-d); }

.masthead-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}

.masthead-nav a {
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.masthead-nav a:hover {
  color: var(--verdigris-d);
  border-bottom-color: var(--verdigris);
}

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

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

.hero {
  padding: clamp(3rem, 9vw, 5.5rem) 0 clamp(2rem, 5vw, 3rem);
}

.hero-name {
  font-family: var(--display);
  font-variation-settings: "SOFT" 14, "WONK" 1, "opsz" 144;
  font-size: clamp(2.9rem, 11vw, 5.25rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 0.4em;
}

.hero-line {
  font-family: var(--display);
  font-variation-settings: "SOFT" 8, "WONK" 0, "opsz" 40;
  font-size: clamp(1.2rem, 3.6vw, 1.6rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.35;
  color: var(--verdigris);
  margin: 0 0 1.75em;
  max-width: 24ch;
}

.hero-bio {
  max-width: var(--measure);
  color: var(--ink);
}

.hero-bio p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Section rule and headings
   -------------------------------------------------------------------------- */

.section {
  padding: var(--rule-space) 0;
  border-top: 1px solid var(--hairline);
}

.section-head {
  margin: 0 0 2.25rem;
}

/* --------------------------------------------------------------------------
   Book list (home page)
   -------------------------------------------------------------------------- */

.books {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
}

.book {
  max-width: var(--measure);
}

.book-title {
  font-family: var(--display);
  font-variation-settings: "SOFT" 12, "WONK" 1, "opsz" 72;
  font-size: clamp(1.55rem, 5vw, 2.05rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}

.book-title a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--verdigris), var(--verdigris));
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 100%;
  transition: background-size 260ms ease;
}

.book-title a:hover {
  color: var(--verdigris-d);
  background-size: 100% 1px;
}

.book-meta {
  margin: 0 0 0.9rem;
}

.book-pitch {
  margin: 0 0 0.9rem;
}

.more {
  display: inline-block;
  font-size: 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid var(--verdigris);
  padding-bottom: 1px;
}

.more::after {
  content: " \203A";
  font-family: var(--display);
}

.more:hover { border-bottom-color: var(--verdigris-d); }

/* --------------------------------------------------------------------------
   Book page header
   -------------------------------------------------------------------------- */

.book-head {
  padding: clamp(2.5rem, 7vw, 4rem) 0 clamp(1.75rem, 4vw, 2.5rem);
  max-width: var(--measure);
}

.book-head .label { display: block; margin-bottom: 0.9rem; }

.book-head-title {
  font-family: var(--display);
  font-variation-settings: "SOFT" 14, "WONK" 1, "opsz" 144;
  font-size: clamp(2.35rem, 8.5vw, 3.6rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 0.55rem;
}

.book-head-meta { margin: 0 0 1.5rem; }

.book-head-pitch {
  font-size: 1.08em;
  color: var(--ink);
  margin: 0;
}

/* --------------------------------------------------------------------------
   The sheet: the first page itself
   -------------------------------------------------------------------------- */

.sheet-section {
  padding: 0 0 clamp(3rem, 7vw, 4.5rem);
}

.sheet-label {
  display: block;
  margin-bottom: 1rem;
}

.sheet {
  background: var(--vellum);
  border: 1px solid var(--hairline);
  box-shadow: 0 1px 2px rgba(20, 32, 46, 0.05),
              0 14px 30px -22px rgba(20, 32, 46, 0.4);
  padding: clamp(1.75rem, 6vw, 3.5rem) clamp(1.5rem, 6vw, 4rem);
}

.sheet-runninghead {
  display: block;
  text-align: center;
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--hairline);
}

.sheet-body {
  max-width: 33rem;
  margin: 0 auto;
  font-size: 1.06em;
  line-height: 1.78;
}

/* Chapter heading, centred above the prose. */
.sheet-chapter {
  font-family: var(--display);
  font-variation-settings: "SOFT" 10, "WONK" 1, "opsz" 48;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 2.25rem;
}

/* Use .tight when a dateline follows the chapter heading. */
.sheet-chapter.tight { margin-bottom: 0.5rem; }

.sheet-dateline {
  display: block;
  text-align: center;
  margin-bottom: 2.25rem;
}

/* Paragraphs in a manuscript indent rather than space out. */
.sheet-body p { margin: 0; text-indent: 1.6em; }
.sheet-body p:first-of-type { text-indent: 0; }

/* A chapter that opens on a line of dialogue: set it slightly larger and
   let it stand alone instead of carrying a drop cap. */
.sheet-body .opening-line {
  font-size: 1.18em;
  line-height: 1.5;
  text-indent: 0;
  margin-bottom: 1.1em;
}

.sheet-body em { font-style: italic; }

/* Drop cap on the opening paragraph. */
.sheet-body p:first-of-type::first-letter {
  font-family: var(--display);
  font-variation-settings: "SOFT" 14, "WONK" 1, "opsz" 144;
  font-weight: 500;
  color: var(--verdigris);
  float: left;
  font-size: 3.35em;
  line-height: 0.82;
  padding: 0.06em 0.1em 0 0;
}

.sheet-body.no-dropcap p:first-of-type::first-letter {
  float: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-variation-settings: normal;
  line-height: inherit;
  color: inherit;
  padding: 0;
}

.sheet-end {
  display: block;
  text-align: center;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}

/* Temporary notice on unfilled excerpts. Delete the element when you paste
   in the real first page. */
.placeholder-note {
  border-left: 3px solid var(--brass);
  background: rgba(154, 123, 63, 0.08);
  padding: 0.7rem 1rem;
  margin: 0 0 2rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.placeholder-note strong { color: var(--brass); }

/* --------------------------------------------------------------------------
   Page-to-page links at the foot of a book page
   -------------------------------------------------------------------------- */

.alsoby {
  padding: var(--rule-space) 0;
  border-top: 1px solid var(--hairline);
}

.alsoby-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
}

.alsoby-list a {
  font-family: var(--display);
  font-variation-settings: "SOFT" 10, "WONK" 1, "opsz" 40;
  font-size: 1.15rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.alsoby-list a:hover { border-bottom-color: var(--verdigris); }

/* --------------------------------------------------------------------------
   Contact and footer
   -------------------------------------------------------------------------- */

.contact {
  padding: var(--rule-space) 0;
  border-top: 1px solid var(--hairline);
}

.contact-line {
  font-family: var(--display);
  font-variation-settings: "SOFT" 10, "WONK" 1, "opsz" 60;
  font-size: clamp(1.3rem, 4.5vw, 1.75rem);
  font-weight: 400;
  line-height: 1.3;
  margin: 0.75rem 0 0;
  word-break: break-word;
}

.footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--hairline);
  color: var(--faded);
  font-size: 0.85rem;
}

.footer p { margin: 0; }

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

.rise {
  animation: rise 700ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.rise-2 { animation-delay: 90ms; }
.rise-3 { animation-delay: 180ms; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise { animation: none; }
  * { transition-duration: 1ms !important; }
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 32rem) {
  .masthead .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  .sheet-body p:first-of-type::first-letter { font-size: 2.9em; }
}
