/* controlgradient.com — single stylesheet, no build step.
   Register: the book cover — gray paper (#E6E6E6), black frame, dark #333 blocks,
   bold sans headings (DejaVu Sans, the cover face), serif body (Liberation Serif,
   the interior face). All fonts self-hosted, free licenses in assets/fonts/. */

@font-face { font-family: "DejaVu Sans"; font-weight: 700; font-style: normal;
  src: url("/assets/fonts/DejaVuSans-Bold.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "DejaVu Sans"; font-weight: 700; font-style: italic;
  src: url("/assets/fonts/DejaVuSans-BoldOblique.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Liberation Serif"; font-weight: 400; font-style: normal;
  src: url("/assets/fonts/LiberationSerif-Regular.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Liberation Serif"; font-weight: 400; font-style: italic;
  src: url("/assets/fonts/LiberationSerif-Italic.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Liberation Serif"; font-weight: 700; font-style: normal;
  src: url("/assets/fonts/LiberationSerif-Bold.woff2") format("woff2"); font-display: swap; }

:root {
  --paper: #e6e6e6;      /* cover background */
  --paper-2: #cccccc;    /* sphere mid-tone: plates, table rules */
  --paper-3: #b3b3b3;    /* sphere shadow tone: secondary rules */
  --block: #333333;      /* cover trapezoid: dark blocks, solid buttons */
  --ink: #000000;
  --ink-soft: #1f1f1f;
  --white: #ffffff;
  --sans: "DejaVu Sans", Verdana, "Bitstream Vera Sans", sans-serif;
  --serif: "Liberation Serif", "Times New Roman", Times, serif;
  --mono: "DejaVu Sans Mono", Consolas, "Liberation Mono", monospace;
  --measure: 40rem;
  --frame: 2px solid var(--ink);
}

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

html { background: var(--paper); }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

body {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--paper);
  padding: 1rem;
}
@media (min-width: 52rem) { body { padding: 1.5rem; } }

/* The cover's inset frame: one black rule around the whole page. */
.frame {
  border: var(--frame);
  min-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}
@media (min-width: 52rem) { .frame { min-height: calc(100vh - 3rem); } }

/* ---------- Header ---------- */

.site-header { border-bottom: var(--frame); }
.site-header .inner {
  max-width: 66rem; margin: 0 auto; padding: 0.9rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.6rem 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand img { width: 2.1rem; height: auto; display: block; }
.brand .wordmark { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }

nav.primary { display: flex; gap: 1.3rem; flex-wrap: wrap; }
nav.primary a {
  font-family: var(--sans); font-weight: 700; font-size: 0.86rem;
  color: var(--ink); text-decoration: none; padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
}
nav.primary a:hover { border-bottom-color: var(--paper-3); }
nav.primary a[aria-current="page"] { border-bottom-color: var(--ink); }

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

h1, h2, h3 { font-family: var(--sans); font-weight: 700; color: var(--ink); line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); letter-spacing: -0.015em; }
h2 { font-size: 1.45rem; margin: 3rem 0 0.9rem; padding-top: 0.9rem; border-top: var(--frame); }
h3 { font-size: 1.1rem; margin: 1.8rem 0 0.5rem; }

/* The cover's subtitle: bold italic sans under a rule */
.subtitle {
  font-family: var(--sans); font-weight: 700; font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem); line-height: 1.3; color: var(--ink);
  border-top: var(--frame); padding-top: 0.8rem; margin: 1rem 0 1.4rem; max-width: 34rem;
}

p { max-width: var(--measure); margin-bottom: 1.05rem; }
ul, ol { max-width: var(--measure); margin: 0 0 1.05rem 1.3rem; }
li { margin-bottom: 0.4rem; }
strong { color: var(--ink); }
em { font-style: italic; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.lede { font-size: 1.25rem; color: var(--ink); max-width: var(--measure); }
.meta { font-family: var(--sans); font-weight: 700; font-size: 0.8rem; color: var(--ink); }

code { font-family: var(--mono); font-size: 0.88em; background: var(--white); padding: 0.05em 0.35em; }

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

main { flex: 1; width: 100%; max-width: 66rem; margin: 0 auto; padding: 2.5rem 1.25rem 3.5rem; }
section + section { margin-top: 2.5rem; }
.hero { padding-top: 1rem; }
.hero h1 { max-width: 46rem; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }
@media (min-width: 52rem) { .two-col { grid-template-columns: 3fr 2fr; gap: 3rem; } }
.two-col.cover-first { align-items: center; }

/* Home hero: the logo on the right, as on the cover */
.hero-mark { width: min(100%, 22rem); margin: 0 auto; }
.hero-mark img { width: 100%; height: auto; display: block; }

/* ---------- Figures ---------- */

figure.plate { background: var(--white); border: var(--frame); padding: 1.25rem; margin: 1.6rem 0; }
figure.plate img { width: 100%; height: auto; display: block; }
figcaption { font-family: var(--sans); font-weight: 700; font-size: 0.8rem; color: var(--ink); margin-top: 0.8rem; }

/* ---------- Buttons ---------- */

.cta-row { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 1.6rem; }
.btn {
  display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 0.9rem;
  text-decoration: none; padding: 0.75rem 1.4rem; border: var(--frame); color: var(--ink);
  background: var(--paper);
}
.btn.solid { background: var(--block); color: var(--white); border-color: var(--block); }
.btn.solid:hover { background: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--white); }

/* ---------- Dark block (the cover trapezoid, squared) ---------- */

.block {
  background: var(--block); color: var(--white); padding: 1.6rem 1.8rem; margin: 2rem 0;
  max-width: var(--measure);
}
.block p, .block strong { color: var(--white); }
.block p:last-child { margin-bottom: 0; }
.block a { color: var(--white); }

/* ---------- Layers table ---------- */

table.layers { width: 100%; border-collapse: collapse; margin: 1.4rem 0 1.8rem; font-size: 1rem; }
table.layers th, table.layers td { text-align: left; padding: 0.7rem 0.8rem; vertical-align: top; border-bottom: 1px solid var(--paper-3); }
table.layers th { font-family: var(--sans); font-weight: 700; font-size: 0.8rem; color: var(--ink); border-bottom: var(--frame); }
table.layers td:first-child { font-family: var(--sans); font-weight: 700; color: var(--ink); white-space: nowrap; }
@media (max-width: 40rem) {
  table.layers thead { display: none; }
  table.layers tr { display: block; border-bottom: var(--frame); padding: 0.6rem 0; }
  table.layers td { display: block; border: 0; padding: 0.2rem 0; }
}

/* ---------- Offers (advisory) ---------- */

.offer { border: var(--frame); background: var(--white); padding: 1.4rem 1.6rem; margin: 1.3rem 0; max-width: var(--measure); }
.offer h3 { margin-top: 0; }
.offer .fit { font-family: var(--sans); font-weight: 700; font-size: 0.82rem; color: var(--ink); margin-bottom: 0.6rem; }
.offer p:last-child { margin-bottom: 0; }

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

.cover { border: var(--frame); background: var(--white); display: block; width: 100%; max-width: 20rem; height: auto; margin: 0 auto; }
.book-facts { list-style: none; margin: 1.2rem 0 0; font-family: var(--sans); font-weight: 700; font-size: 0.85rem; }
.book-facts li { margin: 0; padding: 0.45rem 0; border-top: 1px solid var(--paper-3); }
.book-facts li:last-child { border-bottom: 1px solid var(--paper-3); }

blockquote.blurb { border-left: 4px solid var(--block); padding-left: 1.1rem; margin: 1.4rem 0; max-width: var(--measure); color: var(--ink); }
blockquote.blurb cite { display: block; font-family: var(--sans); font-weight: 700; font-style: normal; font-size: 0.8rem; margin-top: 0.4rem; }

/* ---------- Description (verbatim KDP text) ---------- */

.description p { margin-bottom: 0.9rem; }

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

.site-footer { border-top: var(--frame); }
.site-footer .inner {
  max-width: 66rem; margin: 0 auto; padding: 1.4rem 1.25rem 1.6rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem 1.5rem;
  font-family: var(--sans); font-weight: 700; font-size: 0.78rem; color: var(--ink);
}
