/* Cubela Libre: shared styles for the home page, the series page and the source list.
   Palette and the timeline rule are taken from the Road to Revolution covers. */

@font-face {
  font-family: "Playfair Display";
  src: url("/assets/fonts/playfair-display-latin-900-normal.woff2") format("woff2");
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/assets/fonts/playfair-display-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/assets/fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/assets/fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --black: #000;
  --cream: #f6ecd9;
  --cream-dim: #c2b69e;
  --gold: #d6a84a;
  --gold-soft: rgba(214, 168, 74, 0.4);

  /* Series line colour per book (I red, II gold, III blue, IV green) */
  --book-1: #e3262d;
  --book-2: #c39a58;
  --book-3: #9fc5e5;
  --book-4: #8fbb4a;
  /* Numeral colour per book: the next book's colour, as on the covers */
  --numeral-1: #d6a84a;
  --numeral-2: #6f86e0;
  --numeral-3: #1fbf6c;
  --numeral-4: #d6403c;

  --display: "Playfair Display", "Bodoni 72", Didot, Georgia, serif;
  --text: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;

  --measure: 40rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
}

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

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

body {
  margin: 0;
  background: var(--black);
  color: var(--cream);
  font-family: var(--text);
  font-size: clamp(1.1875rem, 1.05rem + 0.55vw, 1.375rem);
  line-height: 1.52;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

p { margin: 0 0 1em; }

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

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--cream); color: var(--black); padding: 0.5rem 0.9rem;
}
.skip:focus { left: 0.5rem; top: 0.5rem; z-index: 10; }

.column { width: 100%; max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wide { width: 100%; max-width: calc(66rem + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- The timeline rule from the covers: date, wedge, numeral, wedge, date ---------- */

.timeline {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--text); font-weight: 500;
  font-size: 0.78em; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}
.timeline .wedge { flex: 1 1 2rem; height: 3px; background: currentColor; clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.timeline .wedge.right { clip-path: polygon(0 0, 100% 50%, 0 100%); }
.timeline .numeral {
  font-family: var(--display); font-weight: 900;
  font-size: 2.3em; letter-spacing: 0.02em; line-height: 1;
  padding: 0 0.1em;
}

/* ---------- Series page ---------- */

.cover-block { text-align: center; padding-top: clamp(1.75rem, 6vw, 3.5rem); }
.cover-block .emblem { width: clamp(4.25rem, 16vw, 6rem); margin: 0 auto clamp(0.9rem, 3vw, 1.4rem); }
.wordmark {
  font-weight: 900;
  font-size: clamp(3.5rem, 19.5vw, 8.25rem);
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}
.wordmark span { display: block; }
.cover-block .timeline { max-width: 30rem; margin: clamp(1rem, 4vw, 1.6rem) auto 0; }
.cover-block .timeline { font-size: clamp(0.58em, 3vw, 0.7em); gap: clamp(0.3rem, 1.6vw, 0.6rem); }
.cover-block .timeline .numeral { display: inline-flex; gap: 0.42em; font-size: 1.75em; letter-spacing: 0; padding: 0 0.15em; }
.numeral .n1 { color: var(--numeral-1); } .numeral .n2 { color: var(--numeral-2); }
.numeral .n3 { color: var(--numeral-3); } .numeral .n4 { color: var(--numeral-4); }
.descriptor { margin: clamp(1.1rem, 4vw, 1.6rem) auto 0; max-width: 26rem; }
.descriptor .format { display: block; color: var(--cream-dim); }
.tagline { font-style: italic; font-size: 1.12em; line-height: 1.35; margin: 0.9em auto 0; }
.tagline span { display: block; }

.figure { position: relative; margin: clamp(0.5rem, 2vw, 1rem) auto 0; max-width: 87.5rem; }
.figure img { width: 100%; max-height: 38rem; object-fit: cover; object-position: 50% 78%; }
@media (min-width: 87.5rem) {
  .figure img { -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
}
.figure::before, .figure::after { content: ""; position: absolute; left: 0; right: 0; z-index: 1; pointer-events: none; }
.figure::before { top: 0; height: 46%; background: linear-gradient(#000 4%, rgba(0, 0, 0, 0.72) 42%, rgba(0, 0, 0, 0)); }
.figure::after { bottom: 0; height: 30%; background: linear-gradient(rgba(0, 0, 0, 0), #000 94%); }

.pitch section { margin-top: clamp(2.6rem, 8vw, 4rem); }
.pitch h2 { font-size: clamp(1.55rem, 1.2rem + 1.6vw, 2.05rem); margin-bottom: 0.6em; }
.pitch section > p:last-child { margin-bottom: 0; }

.seasons { list-style: none; margin: 1.4rem 0 0; padding: 0; }
.season + .season { margin-top: clamp(2rem, 6vw, 2.75rem); }
.season .timeline { font-size: 0.72em; }
.season-body { display: flex; align-items: center; gap: clamp(1rem, 4vw, 1.6rem); margin-top: 0.9rem; }
.season-body img { flex: 0 0 auto; width: min(35%, 11.5rem); }
.season h3 { font-size: 1.32em; }
.season .arc {
  margin: 0.35em 0 0.7em; font-weight: 500;
  font-size: 0.66em; letter-spacing: 0.11em; text-transform: uppercase;
}
.season .tag { font-style: italic; margin: 0; line-height: 1.4; }
.s1 .numeral { color: var(--numeral-1); } .s1 .arc { color: var(--book-1); }
.s2 .numeral { color: var(--numeral-2); } .s2 .arc { color: var(--book-2); }
.s3 .numeral { color: var(--numeral-3); } .s3 .arc { color: var(--book-3); }
.s4 .numeral { color: var(--numeral-4); } .s4 .arc { color: var(--book-4); }

.after-arc { margin-top: clamp(2rem, 6vw, 2.75rem); padding-top: 1.1em; border-top: 1px solid var(--gold-soft); }

.standing { margin: 0; }
.standing div { padding: 0.85em 0; border-top: 1px solid var(--gold-soft); }
.standing div:last-child { border-bottom: 1px solid var(--gold-soft); }
.standing dt { font-family: var(--display); font-weight: 700; font-size: 0.95em; }
.standing dd { margin: 0.1em 0 0; }

.contact-line { font-family: var(--display); font-weight: 700; font-size: clamp(1.3rem, 5.6vw, 1.9rem); overflow-wrap: anywhere; }
.contact-line a { text-decoration-thickness: 2px; text-underline-offset: 0.22em; }

.foot {
  margin-top: clamp(3.5rem, 10vw, 5.5rem); padding: 1.6rem 0 2.4rem;
  border-top: 1px solid var(--gold-soft);
  color: var(--cream-dim); font-size: 0.86em;
}
.foot p { margin: 0 0 0.5em; }
.foot a { color: var(--cream-dim); }
.foot a:hover { color: var(--gold); }

/* ---------- Home page ---------- */

.masthead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1.5rem; padding-top: 1.25rem; padding-bottom: 1.25rem; }
.masthead .name {
  font-family: var(--display); font-weight: 900; font-size: 1.15rem; letter-spacing: 0.06em; text-transform: uppercase;
  text-decoration: none; display: flex; align-items: center; gap: 0.6rem;
}
.masthead .name img { width: 1.5rem; }
.masthead nav ul { list-style: none; display: flex; gap: clamp(1rem, 4vw, 1.9rem); margin: 0; padding: 0; }
.masthead nav a { text-decoration: none; font-size: 0.95em; }
.masthead nav a:hover { text-decoration: underline; text-decoration-color: var(--gold); }

.flagship { display: grid; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; padding-top: clamp(1rem, 4vw, 2.5rem); }
.flagship .book { width: min(100%, 21rem); margin: 0 auto; box-shadow: 0 1.5rem 4rem rgba(227, 38, 45, 0.22); }
.flagship h1 { font-weight: 900; font-size: clamp(2.6rem, 11vw, 4.6rem); line-height: 0.95; text-transform: uppercase; }
.flagship .arc-title { font-family: var(--text); font-weight: 500; font-size: 0.86em; letter-spacing: 0.22em; text-transform: uppercase; color: var(--book-1); margin: 0.9em 0 0; }
.flagship .timeline { max-width: 22rem; margin: 0.7rem 0 0; }
.flagship .timeline .numeral { color: var(--numeral-1); }
.flagship .tagline { margin: 1em 0 0; max-width: none; }
.flagship .blurb { margin-top: 1em; max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.button {
  display: inline-block; padding: 0.62em 1.15em;
  border: 1px solid var(--gold); color: var(--cream);
  text-decoration: none; font-weight: 500; font-size: 0.95em; line-height: 1.2;
}
.button.primary { background: var(--gold); color: #000; }
.button:hover { background: var(--cream); border-color: var(--cream); color: #000; }
.praise { margin: 1.8rem 0 0; padding-left: 1.1rem; border-left: 2px solid var(--gold); max-width: 34rem; }
.praise p { font-style: italic; font-size: 0.94em; line-height: 1.5; margin: 0 0 0.4em; }
.praise footer { color: var(--cream-dim); font-size: 0.84em; }

.about { margin-top: clamp(3rem, 9vw, 5rem); }
.about .lead { font-size: 1.12em; line-height: 1.5; max-width: 44rem; }
.shelf { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; margin: 1.8rem 0 0; padding: 0; }
.shelf .dates { margin: 0.6rem 0 0; font-size: 0.64em; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.shelf .state { margin: 0.1rem 0 0; font-size: 0.86em; color: var(--cream-dim); }

.sequel { margin-top: clamp(2.2rem, 7vw, 3.25rem); max-width: 44rem; }
.sequel h2 { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2rem); margin-bottom: 0.45em; }
.sequel p { margin: 0; }

.door { margin-top: clamp(2.6rem, 8vw, 4.25rem); padding-top: clamp(1.2rem, 4vw, 1.8rem); border-top: 1px solid var(--gold-soft); display: grid; gap: 0.9rem 2.5rem; scroll-margin-top: 1rem; }
.door > h2 { font-weight: 900; font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem); }
.door .items { display: grid; gap: 1.6rem; }
.item { display: flex; gap: 1.1rem; align-items: flex-start; }
.item > img { flex: 0 0 auto; width: 5.5rem; }
.door h3 { font-size: 1.14em; margin-bottom: 0.25em; }
.door .items p { margin: 0 0 0.35em; max-width: 38rem; }
.linkrow { display: flex; flex-wrap: wrap; gap: 0.25rem 1.3rem; list-style: none; margin: 0.5em 0 0; padding: 0; font-size: 0.95em; }
.talks { list-style: none; margin: 0.6em 0 0; padding: 0; display: grid; gap: 0.7em; }
.talks span { display: block; color: var(--cream-dim); font-size: 0.88em; }
.video { position: relative; aspect-ratio: 16 / 9; background: #0c0a08; margin: 0.6rem 0 0; max-width: 40rem; }
.video.tall { aspect-ratio: 9 / 16; max-width: 17rem; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.closing { margin-top: clamp(2.6rem, 8vw, 4.25rem); padding-top: clamp(1.2rem, 4vw, 1.8rem); border-top: 1px solid var(--gold-soft); display: grid; gap: 2rem 3rem; }
.closing h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.75rem); margin-bottom: 0.5em; }
.closing p:last-child { margin-bottom: 0; }

.foot .links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; margin: 0 0 0.9rem; padding: 0; }
.foot .dedication { font-style: italic; max-width: 40rem; }

@media (min-width: 46rem) {
  .shelf { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
  .door { grid-template-columns: 11rem 1fr; }
  .closing { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 54rem) {
  .flagship { grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); }
  .flagship .book { margin: 0; }
}

/* ---------- Source list ---------- */

.plain-head { padding-top: clamp(1.5rem, 5vw, 3rem); }
.plain-head h1 { font-weight: 900; font-size: clamp(2.4rem, 9vw, 3.6rem); margin-top: 1.2rem; }
.plain-head .back { font-size: 0.9em; color: var(--cream-dim); }
.sources h2 { font-size: 1.28em; margin: 2.2em 0 0.5em; }
.sources ul { margin: 0; padding-left: 1.1em; }
.sources li { margin-bottom: 0.6em; }
.sources li::marker { color: var(--gold); }
.sources .note { color: var(--cream-dim); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  body { background: #fff; color: #000; }
  a { color: #000; }
  .figure::before, .figure::after { display: none; }
}
