/*
 * mjverity.com
 *
 * Brand variables and rules are the implementation of `brand-kit.md`.
 * Any palette or typography change must be made in the brand kit
 * first and propagated here.
 */

:root {
  --bg:        #E8EDE4;
  --ink:       #1A2E3B;
  --ink-soft:  #2D3A42;
  --chart:     #9CB5A0;
  --amber:     #C9892D;

  --font-display: "Inter", "Inter Display",
                  -apple-system, BlinkMacSystemFont,
                  "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif:   "Charter", "Charis SIL",
                  "Cambria", "Iowan Old Style", "Sitka Text",
                  Georgia, "Times New Roman", serif;

  --measure: 36rem;
}

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

html { font-size: 17px; }
@media (min-width: 720px) { html { font-size: 18px; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
@media (min-width: 720px) {
  .page { padding: 5rem 2rem 6rem; }
}

/* ---------- Wordmark ---------- */

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9375rem;
  margin: 0 0 2.5rem;
  color: var(--ink);
}
.wordmark a {
  color: inherit;
  text-decoration: none;
}
.wordmark::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--amber);
  margin-top: 0.75rem;
}

/* ---------- Typography ---------- */

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  margin: 2.5em 0 0.75em;
  letter-spacing: -0.005em;
}

h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  margin-top: 0;
  margin-bottom: 0.5em;
}
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }

p, ul, ol {
  margin: 0 0 1.5em;
}

.lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  margin-bottom: 2em;
}
@media (min-width: 720px) {
  .lede { font-size: 1.125rem; }
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--ink-soft);
  transition: text-decoration-color 0.15s ease,
              text-decoration-thickness 0.15s ease;
}
a:hover {
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 1px;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
}

/* ---------- Email ---------- */

.email {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
  padding: 0.15em 0.45em;
  background: rgba(156, 181, 160, 0.22);
  user-select: all;
  -webkit-user-select: all;
}

/* ---------- Book block (root page) ---------- */

.book {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 3rem 0 0;
  padding-top: 2.5rem;
  border-top: 1px solid var(--chart);
}

@media (min-width: 540px) {
  .book {
    grid-template-columns: 1fr 11rem;
    gap: 2.5rem;
  }
  .book__cover { order: 2; }
  .book__text  { order: 1; }
}

.book__cover {
  margin-top: 0.25rem;
}
.book__cover img {
  display: block;
  width: 100%;
  max-width: 11rem;
  height: auto;
  border: 1px solid rgba(26, 46, 59, 0.15);
  box-shadow:
    0 1px 2px rgba(26, 46, 59, 0.08),
    0 6px 14px rgba(26, 46, 59, 0.12),
    0 20px 40px rgba(26, 46, 59, 0.10);
}

.book__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.2;
  margin: 0 0 0.25em;
  letter-spacing: -0.005em;
}
@media (min-width: 720px) {
  .book__title { font-size: 1.5rem; }
}

.book__subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 1.25em;
  font-size: 1rem;
}

.book__meta {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 1.5em;
}

.book__meta span + span::before {
  content: "·";
  margin: 0 0.6em;
  color: var(--chart);
}

/* ---------- Errata fields ---------- */

.errata-fields {
  margin: 1.25em 0 2em;
  padding-left: 1.5rem;
}
.errata-fields li {
  margin-bottom: 0.5em;
}

.note {
  margin: 2em 0;
  padding: 1em 1.25em;
  border-left: 2px solid var(--amber);
  background: rgba(156, 181, 160, 0.12);
  color: var(--ink-soft);
  font-size: 0.9375rem;
}
.note p:last-child { margin-bottom: 0; }
.note p:first-child { margin-top: 0; }

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

.footer {
  margin-top: 4.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--chart);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  letter-spacing: 0.02em;
}

.footer a { color: var(--ink-soft); }

/* ---------- Reduced-motion ---------- */

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