/* Monarch Lane Press
   Palette: white page, graphite ink, ledger-blue links,
   and one loud object per page: the legal pad (sign-up) or the book cover. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-ext-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #ffffff;
  --ink: #1e2329;
  --muted: #5b636d;
  --rule: #d9dee4;
  --link: #1f4fa3;
  --pad: #fff3a8;
  --pad-line: #9db9e0;
  --pad-margin: #d9534f;
  --cover: #000000;
  --gold: #f2c230;
  --focus: #1f4fa3;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: 2.25rem;
  --step-4: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);

  --measure: 38rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--step-0);
  font-stretch: 100%;
  line-height: 1.6;
  font-weight: 400;
}

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

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

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

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  background: var(--paper);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

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

/* Masthead */

.masthead {
  border-bottom: 1px solid var(--rule);
}
.masthead .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  flex-wrap: wrap;
}
.wordmark {
  font-stretch: 125%;
  font-weight: 800;
  font-size: var(--step-1);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.wordmark span {
  font-weight: 400;
}
.masthead nav a {
  margin-left: 1.25rem;
  font-size: var(--step--1);
  color: var(--ink);
}
.masthead nav a:first-child {
  margin-left: 0;
}

/* Type */

h1,
h2,
h3 {
  font-stretch: 118%;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0;
}
h1 {
  font-size: var(--step-4);
  max-width: 16ch;
  margin-bottom: 1rem;
}
h2 {
  font-size: var(--step-3);
  margin-bottom: 0.75rem;
}
h3 {
  font-size: var(--step-1);
  font-stretch: 110%;
  line-height: 1.2;
}
p {
  margin: 0 0 1rem;
  max-width: var(--measure);
}
.lede {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink);
  max-width: 34rem;
}
.small {
  font-size: var(--step--1);
  color: var(--muted);
}

section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
section + section {
  border-top: 1px solid var(--rule);
}

/* Hero (home) */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.hero h1 {
  margin-bottom: 1.25rem;
}

/* Book cover: CSS rendering, replaced by the real cover image when it loads */

.cover {
  position: relative;
  width: clamp(11rem, 26vw, 16rem);
  aspect-ratio: 5 / 8;
  background: var(--cover);
  color: #fff;
  padding: 1.75rem 1.5rem;
  display: flex;
  text-decoration: none;
  flex-direction: column;
  box-shadow: 0 1px 0 #000, 14px 18px 0 -6px #e9edf1;
  flex-shrink: 0;
}
.cover .c-num {
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 0.95;
  margin-bottom: 0.15em;
}
.cover .c-big {
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.45rem, 3.2vw, 2.1rem);
  line-height: 1;
  margin-bottom: 0.3em;
}
.cover .c-label {
  align-self: flex-start;
  background: var(--gold);
  color: #000;
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  line-height: 1;
  padding: 0.12em 0.22em 0.1em;
  margin-bottom: 0.35em;
}
.cover .c-title {
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(0.95rem, 1.9vw, 1.2rem);
  line-height: 1.1;
}
.cover .c-sub {
  margin-top: 0.9em;
  font-size: clamp(0.55rem, 1vw, 0.68rem);
  line-height: 1.35;
  color: #a7adb4;
}
.cover .c-author {
  margin-top: auto;
  font-size: clamp(0.6rem, 1.1vw, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover.small {
  width: 7.5rem;
  padding: 0.85rem 0.7rem;
}
.cover.small .c-label {
  font-size: 1.05rem;
}
.cover.small .c-title {
  font-size: 0.6rem;
}
.cover.small .c-num {
  font-size: 1.3rem;
}
.cover.small .c-big {
  font-size: 0.95rem;
}
.cover.small .c-sub,
.cover.small .c-author {
  display: none;
}

/* Book list (home) */

.books {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}
.book {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1.75rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--rule);
}
.book:first-child {
  border-top: 0;
  padding-top: 0.5rem;
}
.book h3 {
  margin-bottom: 0.35rem;
}
.book .status {
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: 0.6rem;
}
.book .actions a {
  margin-right: 1.25rem;
  font-weight: 600;
}
.slot {
  width: 7.5rem;
  aspect-ratio: 5 / 8;
  border: 1.5px dashed #b9c1ca;
}

/* Buttons */

.button {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-stretch: 105%;
  padding: 0.8rem 1.3rem;
  cursor: pointer;
  text-decoration: none;
  border-radius: 2px;
}
.button:hover {
  background: #000;
}
.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* The legal pad: the sign-up form.
   Everything inside sits on a 2rem grid, so each line of text rests on a rule. */

.pad {
  --line: 2rem;
  --drop: 0.3rem; /* how far the rule sits above the bottom of each line box */
  position: relative;
  background-color: var(--pad);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--line) - 1px),
    var(--pad-line) calc(var(--line) - 1px),
    var(--pad-line) var(--line)
  );
  background-position: 0 calc(var(--drop) * -1);
  padding: 0 1.5rem var(--line) 3.6rem;
  line-height: var(--line);
  box-shadow: 0 2px 0 #e6d77f, 0 4px 0 #f6eb9c;
}
.pad::before {
  /* the red double margin line */
  content: "";
  position: absolute;
  top: var(--line);
  bottom: 0;
  left: 2.4rem;
  width: 4px;
  border-left: 1px solid var(--pad-margin);
  border-right: 1px solid var(--pad-margin);
}
.pad .pad-top {
  height: var(--line);
  margin: 0 -1.5rem var(--line) -3.6rem;
  background: #7a1f1f;
}
.pad h2 {
  font-size: var(--step-2);
  line-height: var(--line);
  margin: 0;
}
.pad p {
  line-height: var(--line);
  margin: 0;
}
.pad label {
  display: block;
  font-weight: 700;
}
.pad input[type="email"] {
  display: block;
  width: 100%;
  height: var(--line);
  margin: calc(var(--drop) * -1) 0 var(--drop);
  font: inherit;
  font-size: 1.05rem;
  padding: 0 0.5rem;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: #fffbe1;
  color: var(--ink);
  border-radius: 0;
}
.pad input[type="email"]::placeholder {
  color: #7d7a63;
}
.pad .consent {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.6rem;
  align-items: start;
  font-weight: 400;
  font-size: var(--step--1);
  line-height: var(--line);
  margin: var(--line) 0 0;
}
.pad .consent input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.55rem 0 0;
  accent-color: var(--ink);
}
.pad .hp {
  position: absolute;
  left: -9999px;
}
.pad .button {
  line-height: var(--line);
  padding: 0.5rem 1.3rem;
  margin: 0.5rem 0;
}
.pad .msg {
  font-weight: 700;
}
.pad .msg:empty {
  display: none;
}
.pad .fine {
  font-size: var(--step--1);
  color: #4a4f55;
}

/* Reader page layout */

.reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: start;
}
.reader-head {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.reader-head h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem);
  max-width: 18ch;
  margin-bottom: 0.75rem;
}

.inside {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: var(--measure);
}
.inside li {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--rule);
}
.inside li:last-child {
  border-bottom: 1px solid var(--rule);
}
.inside .fmt {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--muted);
  padding-top: 0.15rem;
}
.inside strong {
  display: block;
  font-weight: 700;
}
.inside span.desc {
  color: var(--muted);
  font-size: 0.97rem;
}

/* Update log */

.log {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  margin-top: 1.25rem;
}
.log th,
.log td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.log th {
  font-weight: 700;
  font-size: var(--step--1);
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
}
.log td:first-child {
  white-space: nowrap;
  font-weight: 600;
}

/* Downloads page */

.downloads {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  max-width: 42rem;
}
.downloads li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}
.downloads li:last-child {
  border-bottom: 1px solid var(--rule);
}
.downloads a {
  font-weight: 700;
  white-space: nowrap;
}
.downloads .dl {
  display: flex;
  gap: 1.25rem;
  flex-shrink: 0;
}

/* Prose pages */

.prose h2 {
  font-size: var(--step-2);
  margin: 2.25rem 0 0.6rem;
}
.prose ul {
  max-width: var(--measure);
  padding-left: 1.2rem;
}
.prose li {
  margin-bottom: 0.4rem;
}

/* Footer */

.footer {
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0 2.5rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
}
.footer p {
  margin: 0;
}
.footer a {
  color: var(--muted);
}
.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

/* Small screens */

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero .cover {
    order: -1;
    width: 11rem;
  }
  .reader {
    grid-template-columns: 1fr;
  }
  .reader .pad {
    order: -1; /* on phones, the sign-up comes before the file list */
  }
  .reader-head .cover {
    display: none;
  }
  .book {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 1.1rem;
  }
  .cover.small,
  .slot {
    width: 5.5rem;
  }
  .cover.small .c-label {
    font-size: 0.8rem;
  }
  .cover.small .c-title {
    font-size: 0.45rem;
  }
  .cover.small .c-num {
    font-size: 0.95rem;
  }
  .cover.small .c-big {
    font-size: 0.7rem;
  }
  .log thead {
    display: none;
  }
  .log,
  .log tbody,
  .log tr,
  .log td {
    display: block;
  }
  .log tr {
    border-bottom: 1px solid var(--rule);
    padding: 0.6rem 0;
  }
  .log td {
    border: 0;
    padding: 0.15rem 0;
  }
  .log td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--muted);
  }
  .pad {
    padding-left: 2.9rem;
    padding-right: 1.1rem;
  }
  .pad::before {
    left: 1.9rem;
  }
  .pad .pad-top {
    margin-left: -2.9rem;
    margin-right: -1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
