/* Shared styles for every brand. Mobile first, large type, high contrast.
   A brand changes the look only through the custom properties in its theme.css. */

@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('/assets/fonts/atkinson-hyperlegible-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --font-body: 'Atkinson Hyperlegible', Verdana, Arial, sans-serif;
  --font-heading: var(--font-body);
  --heading-weight: 700;

  --paper: #fbf8f1;        /* page background */
  --ink: #17181a;          /* body text */
  --muted: #45464d;        /* secondary text, still AAA on --paper */
  --line: #5f5c55;         /* input borders, 3:1+ against --paper */
  --band: #1f2328;         /* header band */
  --on-band: #f6f1e6;
  --band-accent: #e0b84c;
  --accent: #8e1b1b;       /* the one primary button */
  --accent-hover: #6e1313;
  --on-accent: #ffffff;
  --link: #7a1717;
  --focus: #f2b705;
  --notice-bg: #fff3d1;
  --notice-line: #9a6b00;
  --error: #a11818;
  --error-bg: #fdecec;
  --card: #ffffff;

  --radius: 10px;
  --measure: 34rem;
  --gutter: 1rem;
}

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

html {
  font-size: 125%;                      /* 20px base on phones */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (min-width: 48em) { html { font-size: 131.25%; } }   /* 21px */

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; padding-bottom: 2.5rem; }

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

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

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px var(--ink);
  border-radius: 4px;
}

h1, h2, h3 {
  color: var(--heading-ink, var(--ink));
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.45rem; margin-top: 1.5rem; }
h3 { font-size: 1.3rem; }
p, ul { margin: 0; }

.wrap { width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.stack > * + * { margin-top: 1.25rem; }

/* Header band */
.band { background: var(--band); color: var(--on-band); }
.band__inner { display: flex; align-items: center; min-height: 3.2rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--on-band);
  font-family: var(--brand-font, var(--font-heading));
  font-weight: 700;
  font-size: var(--brand-size, 0.95rem);
  letter-spacing: var(--brand-tracking, 0.14em);
  text-transform: var(--brand-transform, uppercase);
  text-decoration: none;
  padding: 0.6rem 0;
}
.brand:hover span { text-decoration: underline; }
.brand__mark { width: 2.1rem; height: auto; flex: 0 0 auto; }
.home-logo { width: 8rem; height: auto; }

/* Bonus page hero: the cover sits in the band and overlaps the page below */
/* -1px overlap hides a hairline gap between header and hero on high-DPI screens */
.hero { background: var(--band); padding: calc(0.25rem + 1px) 0 0; margin: -1px 0 3.5rem; }
.hero__inner { display: flex; justify-content: center; }
.cover {
  border-radius: 4px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.25);
  background: #ddd;
}
.cover--hero { width: 42vw; max-width: 10rem; margin-bottom: -3rem; }
@media (min-width: 48em) { .cover--hero { max-width: 14rem; } }

.eyebrow {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
}
.eyebrow + h1 { margin-top: 0.35rem; }
.lead { font-size: 1.2rem; }

/* Form */
.signup { margin-top: 1.75rem; }
.field label { display: block; font-weight: 700; font-size: 1.05rem; margin-bottom: 0.4rem; }
input[type='email'], input[type='text'] {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.6rem 0.8rem;
  font: inherit;
  font-size: 1.15rem;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--line);
  border-radius: var(--radius);
}
input[type='email']:focus { border-color: var(--ink); }
input[aria-invalid='true'] { border-color: var(--error); background: var(--error-bg); }
.field-error, .form-status {
  color: var(--error);
  font-weight: 700;
  margin-top: 0.5rem;
}
.form-status { background: var(--error-bg); border-left: 6px solid var(--error); padding: 0.75rem 1rem; border-radius: 4px; }

.check { display: flex; gap: 0.8rem; align-items: flex-start; }
.check input {
  flex: 0 0 auto;
  width: 1.7rem; height: 1.7rem;
  margin: 0.1rem 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.check label { cursor: pointer; }
.check__label { display: block; font-weight: 700; }
.check__hint { display: block; margin-top: 0.3rem; font-size: 0.9rem; color: var(--muted); }

/* Honeypot: hidden from people, visible to naive bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: block;
  width: 100%;
  min-height: 3.4rem;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.btn[aria-disabled='true'] { opacity: 0.75; cursor: progress; }
.btn--secondary {
  display: inline-block;
  width: auto;
  min-height: 0;
  background: transparent;
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: none;
  font-size: 1.05rem;
  padding: 0.65rem 1.1rem;
}
.btn--secondary:hover { background: var(--ink); color: var(--paper); }
.btn--download { font-size: 1.25rem; }
.btn--inline { display: inline-block; width: auto; min-height: 0; padding: 0.7rem 1.2rem; font-size: 1.05rem; }

.fineprint { font-size: 0.85rem; color: var(--muted); }
.meta { color: var(--muted); font-size: 0.95rem; }

/* Download page */
.download-head { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; }
.cover--thumb { width: 5.5rem; flex: 0 0 auto; }
.tips { padding-left: 1.2rem; }
.tips li + li { margin-top: 0.6rem; }
/* Shown only when the URL ends in #sent, #sent-confirm, ... (no JavaScript needed).
   The large scroll margin keeps the page at the top instead of jumping to the notice. */
.when-target { display: none; scroll-margin-top: 100vh; }
.when-target:target { display: block; }
.notice {
  margin-top: 1.5rem;
  background: var(--notice-bg);
  border-left: 6px solid var(--notice-line);
  border-radius: 4px;
  padding: 0.9rem 1rem;
}
.notice p + p { margin-top: 0.6rem; }
.invite {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
/* Just ticked the box on the bonus form? Then don't invite them again. */
#sent-confirm:target ~ .invite, #confirm:target ~ .invite { display: none; }

/* Home page */
.intro { padding-top: 2rem; }
.books { margin-top: 1rem; }
.book {
  display: grid;
  grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.book__body > * + * { margin-top: 0.75rem; }
.book__subtitle { color: var(--muted); font-size: 0.95rem; }
.book__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.book__bonus { font-size: 0.95rem; }
@media (max-width: 30em) {
  .book { grid-template-columns: 1fr; }
  .book__cover { max-width: 11rem; }
}

/* Long text (privacy policy) */
.prose { padding-top: 2rem; }
.prose > * + * { margin-top: 1rem; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li + li { margin-top: 0.6rem; }
.link-list { padding-left: 1.2rem; }
.link-list li + li { margin-top: 0.5rem; }

.site-footer { border-top: 1px solid rgba(0, 0, 0, 0.15); padding: 1.25rem 0 2rem; font-size: 0.9rem; color: var(--muted); }
.site-footer a { color: var(--muted); }

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

/* Basalt Bracken look, taken from the Twenty-Four Doors cover: night-sky navy,
   ribbon crimson and the warm cream-gold of the title lettering. Only custom
   properties and fonts belong here; layout lives in core. */

@font-face {
  font-family: 'Libre Baskerville';
  src: url('/assets/brand/fonts/libre-baskerville-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --font-heading: 'Libre Baskerville', Georgia, 'Times New Roman', serif;

  --paper: #fbf8f1;        /* snow */
  --ink: #17181a;
  --heading-ink: #0b1a33;  /* navy of the cover's bottom lettering */
  --muted: #45464d;
  --band: #0f2140;         /* night sky */
  --on-band: #f6efe0;
  --band-accent: #f3d39c;  /* title cream-gold */
  --accent: #9b1b20;       /* ribbon crimson */
  --accent-hover: #7a1418;
  --link: #8a1a1e;

  /* header name next to the logo sign, set like the logo's own wordmark */
  --brand-font: var(--font-body);
  --brand-size: 1.15rem;
  --brand-tracking: 0.01em;
  --brand-transform: none;
}
