/* ==========================================================================
   EDBooks — site v0.2
   Editorial / small-press system. No framework, no build step, no CDN.
   Fonts are self-hosted so the site has no third-party dependency.
   ========================================================================== */

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-var.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-var-italic.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "InterVar";
  src: url("/fonts/inter-var.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

/* --- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

/* --- Tokens ------------------------------------------------------------ */
:root {
  --paper:      #f5f1e8;
  --paper-warm: #ece5d8;
  --paper-deep: #e2d9c7;
  --card:       #fffdf8;

  --ink:        #16150f;   /* 15.5:1 on paper */
  --ink-2:      #3c3930;   /*  9.4:1 */
  --ink-3:      #5f5a4d;   /*  5.6:1 — meta only */

  --green:      #22503b;
  --green-deep: #17392a;
  --rust:       #93361d;
  --ochre:      #c98a3c;

  --rule:       #d5cbb6;
  --rule-soft:  #e4dccb;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "InterVar", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --shell: 74rem;
}

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, .3vw + 1rem, 1.1875rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 480; line-height: 1.12; letter-spacing: -.018em; text-wrap: balance; }
p { text-wrap: pretty; }

a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--rust); }

:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; border-radius: 1px; }
::selection { background: #dee5da; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: .75rem 1.25rem; font-family: var(--sans); font-size: .875rem;
}
.skip:focus { left: var(--gutter); top: .5rem; }

.eyebrow {
  font-family: var(--sans); font-size: .6875rem; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
}
.lede { font-size: 1.18em; line-height: 1.5; color: var(--ink-2); }

/* --- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(10px);
  backdrop-filter: saturate(1.5) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 4.25rem;
}
.wordmark {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  font-family: var(--sans); font-weight: 600; font-size: .9375rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.wordmark span { color: var(--rust); }

.nav { display: flex; align-items: center; gap: clamp(.75rem, 2.2vw, 1.75rem); }
.nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  font-family: var(--sans); font-size: .8125rem; font-weight: 450;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.nav a:hover { color: var(--rust); text-decoration: underline; text-underline-offset: .35em; }

/* Mobile: navigation stays visible — it is the only route to the two
   strategically important sections. */
@media (max-width: 44rem) {
  .site-header__inner { flex-direction: column; align-items: stretch; gap: 0; min-height: 0; padding-block: .7rem 0; }
  .nav {
    justify-content: space-between; gap: .5rem;
    padding-bottom: .4rem; overflow-x: auto; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: .75rem; }
}

/* --- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-size: .875rem; font-weight: 500;
  padding: .8125rem 1.375rem; min-height: 2.875rem;
  border: 1px solid transparent; border-radius: 2px;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--green-deep); color: var(--paper); }
.btn--ghost { border-color: var(--rule); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--ink-2); color: var(--ink); background: color-mix(in srgb, var(--paper-deep) 55%, transparent); }
.btn[aria-disabled="true"], .btn[disabled] { opacity: .5; pointer-events: none; }

/* --- Cover ---------------------------------------------------------------
   The three-story front-cover artwork. Native ratio 0.6081 against a
   130 x 198 trim of 0.6566, so it is shown uncropped at its own ratio and
   the caption says print geometry is still pending.
   width/height are set on the element so nothing shifts while it loads. ---- */
.cover-frame { display: flex; justify-content: center; }
.cover {
  width: min(19rem, 78%);
  height: auto;
  border-radius: 1px 3px 3px 1px;
  background: #0d0d0b;
  box-shadow:
    -1px 0 0 0 rgba(0, 0, 0, .35),
    18px 26px 46px -22px rgba(22, 21, 15, .55);
}
.cover--sm { width: min(13.5rem, 70%); }

.figure-note {
  margin-top: 1.25rem; text-align: center;
  font-family: var(--sans); font-size: .6875rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}

/* --- Hero -------------------------------------------------------------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2.5rem, 6vw, 4.5rem); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.15rem); line-height: 1.02;
  letter-spacing: -.03em; margin-block: .9rem 1.1rem; max-width: 15ch;
}
.hero h1 em { font-style: italic; color: var(--green); }
.hero p.lede { max-width: 42ch; }

.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.85rem; }

.status-line {
  margin-top: 1.85rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  font-family: var(--sans); font-size: .8125rem; line-height: 1.6;
  color: var(--ink-3); max-width: 46ch;
}
.status-line strong { color: var(--ink-2); font-weight: 550; }

@media (max-width: 56rem) {
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero__figure { order: -1; }
  .cover { width: min(15rem, 64%); }
}

/* --- Sections ---------------------------------------------------------- */
.section { padding-block: clamp(3.25rem, 8vw, 5.75rem); }
.section--tint { background: var(--paper-warm); border-block: 1px solid var(--rule); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink h2, .section--ink h3 { color: var(--paper); }
.section--ink p { color: #c6c1b1; }
.section--ink .eyebrow { color: #98927f; }

.section__head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__head h2 { font-size: clamp(1.75rem, 3.5vw, 2.55rem); margin-block: .7rem .8rem; }
.section__head p { color: var(--ink-2); max-width: 50ch; }
.section--ink .section__head p { color: #c6c1b1; }

/* --- Manifesto --------------------------------------------------------- */
.manifesto__statement {
  font-family: var(--serif); font-size: clamp(1.8rem, 4.2vw, 3rem);
  line-height: 1.12; letter-spacing: -.025em; max-width: 20ch;
  margin-block: .9rem 2.5rem;
}
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: clamp(1.75rem, 4vw, 3rem); }
.note { border-top: 2px solid currentColor; padding-top: .9rem; }
.note__num { font-family: var(--sans); font-size: .6875rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ochre); }
.note h3 { font-size: 1.3rem; margin-block: .4rem .5rem; }
.note p { font-size: .95em; line-height: 1.55; }

/* --- Catalogue: three visually distinct states -------------------------- */
.catalogue { display: grid; gap: clamp(1.25rem, 2.5vw, 1.75rem); grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr)); align-items: start; }

.entry { border-radius: 2px; padding: clamp(1.4rem, 2.8vw, 1.9rem); display: flex; flex-direction: column; height: 100%; }
.entry--book      { background: var(--card); border: 1px solid var(--rule); }
.entry--series    { background: transparent; border: 1px solid var(--rule); }
.entry--programme { background: transparent; border: 1px dashed #bdb29a; }

.chip {
  display: inline-flex; align-items: center; gap: .45rem; align-self: flex-start;
  font-family: var(--sans); font-size: .6875rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  padding: .3rem .65rem; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--ink-3); background: var(--paper);
}
.chip::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; }
.chip--book { color: var(--rust); border-color: color-mix(in srgb, var(--rust) 30%, var(--rule)); }
.chip--series { color: var(--green); border-color: color-mix(in srgb, var(--green) 28%, var(--rule)); }

.entry__mark { height: 4.75rem; display: flex; align-items: flex-end; margin: 1.4rem 0 1.1rem; }
.entry__mark svg { height: 100%; width: auto; }
.entry__mark--book img {
  height: 100%; width: auto; border-radius: 1px;
  box-shadow: 5px 7px 16px -9px rgba(22, 21, 15, .6);
}
.entry__mark--series { gap: .35rem; }
.entry__mark--series i {
  display: block; height: 100%; aspect-ratio: 130/198; border-radius: 1px;
  border: 1px solid var(--rule); background: var(--paper-deep);
}
.entry__mark--series i:nth-child(2) { background: var(--paper-warm); }
.entry__mark--series i:nth-child(3) { background: var(--card); }

.entry__kind { font-family: var(--sans); font-size: .6875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.entry h3 { font-size: 1.45rem; margin-block: .5rem .25rem; }
.entry__sub { font-style: italic; color: var(--ink-2); font-size: .95em; margin-bottom: .7rem; }
.entry p { font-size: .95em; color: var(--ink-2); line-height: 1.55; }
.entry__foot { margin-top: auto; padding-top: 1.4rem; }
.entry__link {
  display: inline-flex; align-items: center; min-height: 1.75rem;
  font-family: var(--sans); font-size: .8125rem; font-weight: 500;
  text-decoration: none; box-shadow: inset 0 -1px 0 currentColor;
}

.spec { list-style: none; padding: 0; margin: 1rem 0 0; border-top: 1px solid var(--rule-soft); }
.spec li {
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
  padding: .5rem 0; border-bottom: 1px solid var(--rule-soft);
  font-family: var(--sans); font-size: .8125rem;
}
.spec .k { color: var(--ink-3); }
.spec .v { color: var(--ink-2); text-align: right; font-weight: 450; }

/* --- Title feature ------------------------------------------------------ */
/* Keep prose to a readable measure even in a wide column. */
.title-feature p { max-width: 64ch; }
.title-feature { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 52rem) { .title-feature { grid-template-columns: 1fr; } .cover--sm { width: min(12.5rem, 58%); } }

.contents { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.contents li { display: flex; align-items: baseline; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--rule-soft); }
.contents li:first-child { border-top: 1px solid var(--rule-soft); }
.contents .t { font-style: italic; }
.contents .dots { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-.25em); }
.contents .n { font-family: var(--sans); font-size: .8125rem; color: var(--ink-3); }
.contents .lead { font-family: var(--sans); font-size: .625rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rust); }

/* --- A titled block inside a form, so a deep link lands somewhere that
       explains itself rather than mid-way down someone else's question. --- */
.form-block {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
  scroll-margin-top: 7rem;
}
.form-block__head { font-size: 1.2rem; margin-block: .4rem .45rem; }
.form-block__note {
  font-family: var(--sans); font-size: .8125rem; line-height: 1.55;
  color: var(--ink-3); margin-bottom: 1.35rem; max-width: 52ch;
}

/* --- Interest block under the title feature ---------------------------- */
.interest-wrap { margin-top: clamp(2.5rem, 5vw, 3.75rem); }
.interest-wrap .form-card { max-width: 46rem; margin-inline: auto; }

/* --- Status board ------------------------------------------------------- */
.progress { list-style: none; padding: 0; margin: 0; max-width: 46rem; }
.progress li {
  display: grid; grid-template-columns: 8.5rem 1fr auto; gap: 1rem; align-items: baseline;
  padding: .95rem 0; border-bottom: 1px solid rgba(213,203,182,.18);
}
.progress .stage { font-family: var(--sans); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: #98927f; }
.progress .what { color: #d9d4c5; }
.progress .state { font-family: var(--sans); font-size: .75rem; color: var(--ochre); white-space: nowrap; }
.progress .state--done { color: #86b697; }
@media (max-width: 40rem) {
  .progress li { grid-template-columns: 1fr auto; }
  .progress .stage { grid-column: 1 / -1; margin-bottom: .15rem; }
}

/* --- Forms -------------------------------------------------------------- */
.form-card { background: var(--card); border: 1px solid var(--rule); border-radius: 2px; padding: clamp(1.4rem, 3.2vw, 2.25rem); }

.field { margin-bottom: 1.35rem; }
.field > label, .fieldset__legend {
  display: block; font-family: var(--sans); font-size: .8125rem; font-weight: 500;
  color: var(--ink); margin-bottom: .4rem;
}
.hint { font-family: var(--sans); font-size: .75rem; color: var(--ink-3); margin-top: .4rem; line-height: 1.45; }
.opt { color: var(--ink-3); font-weight: 400; }

input[type="text"], input[type="email"], select, textarea {
  width: 100%; font-family: var(--sans); font-size: .9375rem;
  padding: .75rem .875rem; min-height: 2.875rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 2px; color: var(--ink);
}
textarea { min-height: 5.75rem; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #8d8676; }
input:hover, select:hover, textarea:hover { border-color: #bfb49c; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: 2px solid color-mix(in srgb, var(--green) 40%, transparent); outline-offset: 1px; }

fieldset { border: 0; padding: 0; margin: 0 0 1.35rem; }

.choices { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .55rem; }
.choice { position: relative; }
.choice input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; min-height: 2.5rem;
  font-family: var(--sans); font-size: .8125rem; line-height: 1.2;
  padding: .6rem .85rem; border: 1px solid var(--rule); border-radius: 2px;
  background: var(--paper); color: var(--ink-2);
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
.choice input:hover + span { border-color: #b3a68b; }
.choice input:checked + span { background: var(--green); border-color: var(--green); color: #f2efe6; }
.choice input:focus-visible + span { outline: 2px solid var(--rust); outline-offset: 2px; }

.hp { position: absolute; left: -9999px; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.75rem; }
.form-note { font-family: var(--sans); font-size: .75rem; color: var(--ink-3); line-height: 1.5; flex: 1 1 13rem; }

.form-status {
  display: none; border-left: 3px solid var(--green);
  background: color-mix(in srgb, var(--green) 7%, var(--card));
  padding: 1.35rem; border-radius: 2px;
}
.form-status[data-state="ok"], .form-status[data-state="err"] { display: block; }
.form-status[data-state="err"] { border-left-color: var(--rust); background: color-mix(in srgb, var(--rust) 7%, var(--card)); }
.form-status h3 { font-size: 1.2rem; margin-bottom: .3rem; }
.form-status p { font-family: var(--sans); font-size: .875rem; color: var(--ink-2); }
.is-sent { display: none !important; }

/* --- Split (aside + form) ----------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 54rem) { .split { grid-template-columns: 1fr; } }
.split__aside h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); margin-block: .7rem .9rem; }
.split__aside p { color: var(--ink-2); }
.split__aside p + p { margin-top: .9rem; }
.split__aside .pull {
  font-size: 1.22em; line-height: 1.4; font-style: italic; color: var(--ink);
  border-left: 2px solid var(--rust); padding-left: 1.1rem; margin-block: 1.4rem;
}
.split__aside ul { font-family: var(--sans); font-size: .875rem; color: var(--ink-2); padding-left: 1.1rem; margin-top: 1.1rem; line-height: 1.7; }

/* --- Footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: 3rem 2rem; background: var(--paper-warm); }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr)); gap: 2rem; }
.site-footer h4 { font-family: var(--sans); font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .7rem; font-weight: 500; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: .1rem; }
.site-footer li a { display: inline-flex; align-items: center; min-height: 1.75rem; }
.site-footer a, .site-footer p, .site-footer li { font-family: var(--sans); font-size: .875rem; color: var(--ink-2); }
.footer__legal { margin-top: 2.75rem; padding-top: 1.35rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.footer__legal p { font-size: .75rem; color: var(--ink-3); max-width: 54ch; }

/* --- Thanks page --------------------------------------------------------- */
.thanks { min-height: 68vh; display: flex; align-items: center; padding-block: 5rem; }
.thanks h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); margin-block: .8rem .9rem; }
.thanks p { color: var(--ink-2); max-width: 46ch; }
.thanks .next { margin-top: 2.25rem; padding-top: 1.35rem; border-top: 1px solid var(--rule); }
