/* ==========================================================================
   Global Academic Partnerships — site styles
   Layout: textbook spread (≥1200px) · single page (768–1199px) · column (<768px)
   ========================================================================== */

:root {
  /* ---- Typography tokens ------------------------------------------------ */
  --stack-gaps: "GAPs", "Comfortaa", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --stack-comfortaa: "Comfortaa", "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --stack-inter: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-heading: var(--stack-gaps);
  --font-subtitle: var(--stack-comfortaa);
  /* Body font: change this ONE variable to switch body/interface text.
     Headings (--font-heading) and subtitles (--font-subtitle) are unaffected. */
  --font-body: var(--stack-inter);
  --text-xs: 0.8125rem;
  /* 13px labels, folios */
  --text-sm: 0.9375rem;
  /* 15px nav, buttons, small copy */
  --text-base: 1.0625rem;
  /* 17px body */
  --text-lg: clamp(1.125rem, 1rem + 0.4vw, 1.3125rem);
  --text-xl: clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem);
  --text-2xl: clamp(2.25rem, 1.6rem + 2.4vw, 3.5rem);
  --text-hero: clamp(3rem, 1.6rem + 5vw, 6.25rem);
  /* ---- Colour: black, white and warm greys ------------------------------ */
  --ink: #111110;
  --ink-2: #444444;
  /* secondary text (7.7:1 on --grey) */
  --ink-3: #5c5c5c;
  /* labels/meta    (5.3:1 on --grey) */
  --paper: #ffffff;
  --grey: #e4e4e4;
  /* light grey from Plate II: desk and in-page groups */
  --tint: var(--grey);
  --tint-2: #d9d9d9;
  /* stronger group / hover */
  --desk: var(--grey);
  --rule: #cccccc;
  /* Call-to-action teal from our.ink. --teal is the brand teal (used for large
     display text, 4.1:1 on white); --cta is a deeper shade so white button
     text stays readable (5.6:1). */
  --teal: #0F8B8D;
  --cta: #0b7375;
  --cta-hover: #095f61;
  --rule-strong: #111110;
  /* ---- Space ------------------------------------------------------------ */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.25rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-20: 5rem;
  --page-pad-x: clamp(1.25rem, 5vw, 5.75rem);
  --page-pad-y: clamp(2.5rem, 5vw, 5.75rem);
  --header-h: 76px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

/* Body font switch (used by the typography preview: ?body=comfortaa) */
html[data-body="comfortaa"] {
  --font-body: var(--stack-comfortaa);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

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

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

p {
  margin: 0 0 var(--s-5);
  max-width: 60ch;
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-2) var(--s-4);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--s-4);
}

/* ---- Type roles ---------------------------------------------------------- */
.h-display,
.h-section,
.gaps {
  font-family: var(--font-heading);
  font-weight: 400;
  /* the only weight supplied */
  font-style: normal;
  font-synthesis: none;
  /* never fake bold/italic for GAPs */
  letter-spacing: 0;
  font-kerning: normal;
}

.h-display {
  font-size: var(--text-hero);
  line-height: 0.98;
  margin: 0 0 var(--s-6);
}

.h-section {
  font-size: var(--text-2xl);
  line-height: 1.04;
  margin: 0 0 var(--s-5);
  text-wrap: balance;
}

.subtitle {
  font-family: var(--font-subtitle);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.45;
  color: var(--ink);
  margin: 0 0 var(--s-8);
  max-width: 36ch;
  text-wrap: balance;
}

.h-sub {
  font-family: var(--font-subtitle);
  font-weight: 700;
  font-size: var(--text-xl);
  line-height: 1.25;
  margin: 0 0 var(--s-4);
}

.h-item {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1.35;
  margin: 0 0 var(--s-1);
}

.label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--s-4);
}

.muted {
  color: var(--ink-2);
}

.small {
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--desk) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(10px);
  -webkit-backdrop-filter: saturate(1.1) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
}

.brand__mark {
  width: 38px;
  height: 43px;
  flex: none;
}

.brand__name {
  font-size: 1.75rem;
  line-height: 1;
  white-space: nowrap;
  /* GAPs has only a Regular cut: a thin outline in the text colour makes the
     name read stronger without synthesising bold. */
  -webkit-text-stroke: 0.034em currentColor;
  paint-order: stroke fill;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.6vw, 1.75rem);
}

.nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-2);
  padding: var(--s-2) 0;
}

.nav a:hover,
.nav a[aria-current="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
}

.nav .btn {
  color: var(--paper);
  padding: 0.55rem 1rem;
}

.nav .btn:hover {
  color: var(--paper);
  text-decoration: none;
}

.menu-toggle {
  display: none;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0.7rem 1.2rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--cta);
  border-radius: 2px;
  background: var(--cta);
  color: var(--paper);
  transition: background 160ms var(--ease), color 160ms var(--ease), border-color 160ms var(--ease);
}

.btn:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--cta);
  border-color: var(--cta);
}

.btn--ghost:hover {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--paper);
}

.btn svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-8);
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.textlink:hover {
  border-bottom-width: 2px;
  padding-bottom: 0;
}

.textlink svg {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   The book: spreads and pages
   ========================================================================== */
.book {
  padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 3vw, 2.5rem) var(--s-12);
}

.spread {
  position: relative;
  max-width: 1440px;
  margin: 0 auto clamp(2rem, 4.5vw, 4.5rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 18px 40px -24px rgba(40, 32, 20, .35);
}

.page {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--page-pad-y) + 1.5rem) var(--page-pad-x) calc(var(--page-pad-y) + 1.5rem);
  min-height: min(92vh, 920px);
}

/* Gutter shading toward the spine */
/*
.page--verso { background: linear-gradient(to left, rgba(60,50,35,.10), rgba(60,50,35,0) 48px), var(--paper); }
.page--recto { background: linear-gradient(to right, rgba(60,50,35,.08), rgba(60,50,35,0) 40px), var(--paper); }
*/
.page--verso,
.page--recto {
  background: var(--paper);
}

.spread::after {
  /* spine line */
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(60, 50, 35, .16);
}

/* Running heads and folios */
.runhead,
.folio {
  position: absolute;
  left: var(--page-pad-x);
  right: var(--page-pad-x);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
}

.runhead {
  top: calc(var(--page-pad-y) * 0.55);
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--s-2);
}

.folio {
  bottom: calc(var(--page-pad-y) * 0.5);
  font-variant-numeric: tabular-nums;
}

.page--verso .folio {
  justify-content: flex-start;
}

.page--recto .folio {
  justify-content: flex-end;
}

.page--recto .runhead {
  justify-content: flex-end;
}

.page__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page__body> :last-child {
  margin-bottom: 0;
}

.push-end {
  margin-top: auto;
}

/* Full-bleed plate page (frontispiece) */
/* Opening verso: publisher's device */
.page--device {
  justify-content: center;
  align-items: center;
}

.device {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-4);
  margin: auto;
}

.device__logo {
  width: clamp(150px, 15vw, 220px);
  aspect-ratio: 146 / 166;
  height: auto;
  color: var(--ink);
}

.device__name {
  font-size: clamp(1.4rem, 1.1rem + 0.8vw, 1.9rem);
  line-height: 1.1;
  margin: var(--s-4) 0 0;
}

.device__line {
  font-size: var(--text-xs);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.page--plate {
  padding: 0;
  background: var(--tint);
}

.page--plate .plate {
  position: absolute;
  inset: 0;
  margin: 0;
}

.page--plate .plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.page--plate figcaption {
  position: absolute;
  left: var(--page-pad-x);
  bottom: calc(var(--page-pad-y) * 0.5);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--ink);
  background: rgba(255, 255, 255, .88);
  padding: 4px 10px;
}

/* ---- Groups (warm grey) -------------------------------------------------- */
.group {
  background: var(--tint);
  padding: clamp(1.25rem, 2.2vw, 2rem);
}

.group+.group {
  margin-top: 2px;
}

.group--rule {
  border-top: 2px solid var(--ink);
}

.stack>*+* {
  margin-top: var(--s-6);
}

/* ---- Opening ------------------------------------------------------------- */
.title-page .h-display {
  max-width: 9ch;
}

.title-page .lead {
  font-size: var(--text-base);
  color: var(--ink-2);
}

.imprint {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
  margin-top: var(--s-10);
}

.imprint .brand__mark {
  width: 34px;
  height: 39px;
}

.imprint p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.4;
}

.imprint strong {
  color: var(--ink);
  font-weight: 600;
  display: block;
}

/* ---- About / principles -------------------------------------------------- */
.principles {
  display: grid;
  gap: 2px;
  margin-top: var(--s-8);
}

.principles li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: var(--s-3);
  background: var(--tint);
  padding: var(--s-5) var(--s-6);
}

.principles .num {
  font-family: var(--font-heading);
  font-synthesis: none;
  font-size: 1.5rem;
  line-height: 1.1;
}

.principles p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-2);
}

/* ---- Contents (TOC) ------------------------------------------------------ */
.toc {
  border-top: 2px solid var(--ink);
  margin-top: var(--s-2);
}

.toc li {
  border-bottom: 1px solid var(--rule);
}

.toc a {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: var(--s-4);
  align-items: start;
  padding: var(--s-6) var(--s-3) var(--s-6) 0;
  text-decoration: none;
  transition: background 160ms var(--ease), padding 200ms var(--ease);
}

.toc a:hover {
  background: var(--tint);
  padding-left: var(--s-3);
}

.toc .toc__n {
  font-family: var(--font-heading);
  font-synthesis: none;
  font-size: 1.75rem;
  line-height: 1;
  padding-top: 2px;
}

.toc .toc__t {
  font-family: var(--font-heading);
  font-synthesis: none;
  font-size: var(--text-xl);
  line-height: 1.1;
  display: block;
  margin-bottom: 4px;
}

.toc .toc__d {
  font-size: var(--text-sm);
  color: var(--ink-2);
  display: block;
  line-height: 1.5;
}

.toc .toc__k {
  font-size: var(--text-xs);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: 6px;
}

.toc .toc__p {
  font-size: var(--text-sm);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}

.toc__mark {
  height: 22px;
  width: auto;
  margin-bottom: 8px;
}

/* ---- Brand marks (original colours and typefaces) ------------------------ */
.chapter-mark {
  height: 40px;
  width: auto;
  align-self: flex-start;
  margin-bottom: var(--s-6);
}

.ink-mark {
  display: inline-flex;
  align-items: flex-start;
  gap: 2px;
}

.ink-mark img {
  height: 40px;
  width: auto;
}

.ink-mark sup {
  font-size: .55rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: #0F8B8D;
  line-height: 1;
}

/* Chapter titles set as the brands' own logos */
.h-logo {
  margin: 0 0 var(--s-5);
  line-height: 1;
  font-weight: 400;
}

.h-logo .ink-mark img {
  height: clamp(56px, 5vw, 76px);
  width: auto;
}

.h-logo .ink-mark sup {
  font-size: .8rem;
}

.h-logo .ref-mark {
  height: clamp(60px, 5.4vw, 82px);
  width: auto;
  display: block;
}

.ip-logo {
  font-family: "Revalia", var(--font-heading);
  font-synthesis: none;
  color: #830E0E;
  font-size: clamp(1.6rem, 1.1rem + 1.5vw, 2.5rem);
  line-height: 1.15;
}

.ip-logo__mono {
  margin-right: .15em;
}

.ip-mark {
  align-self: flex-start;
  font-family: "Revalia", var(--font-heading);
  font-weight: 400;
  font-synthesis: none;
  color: #830E0E;
  font-size: 2.1rem;
  line-height: 1;
  margin-bottom: var(--s-6);
}

.toc .ip-mark {
  width: 22px;
  height: 22px;
  font-size: .78rem;
  margin-bottom: 8px;
}

/* ---- Chapter 1: books ---------------------------------------------------- */
.byline {
  font-size: var(--text-sm);
  color: var(--ink-2);
  margin-bottom: var(--s-8);
}

.byline strong {
  color: var(--ink);
  font-weight: 600;
}

.feature-book {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr;
  gap: var(--s-6);
  align-items: start;
}

.feature-book p {
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.book-cover {
  display: block;
  border: 1px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--paper);
}

.book-cover img,
.cover--image img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: left top;
  filter: grayscale(1);
  transition: filter 400ms var(--ease);
}

.book-cover:hover img,
.book-cover:focus-visible img,
.cover--image:hover img {
  filter: none;
}

.cover--image {
  padding: 0 !important;
}

.cover--image img {
  aspect-ratio: auto;
}

.cover {
  aspect-ratio: 2 / 3;
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 12% 11%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 4px 4px 0 var(--ink);
  position: relative;
  overflow: hidden;
}

.cover__series {
  font-size: 0.5rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--ink-2);
}

.cover__title {
  font-family: var(--font-heading);
  font-synthesis: none;
  font-size: clamp(1rem, 1.6vw, 1.45rem);
  line-height: 1.02;
}

.cover__grid {
  position: absolute;
  inset: auto 11% 18% 11%;
  height: 30%;
  background-image: linear-gradient(var(--ink) 1px, transparent 1px), linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 20% 25%;
  opacity: .14;
  border-right: 1px solid rgba(17, 17, 16, .14);
  border-bottom: 1px solid rgba(17, 17, 16, .14);
}

.cover__authors {
  font-size: 0.5rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
  position: relative;
}

.cover--dark {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 4px 4px 0 var(--tint-2);
  border-color: var(--ink);
}

.cover--dark .cover__series,
.cover--dark .cover__authors {
  color: #cfcac2;
}

.cover--dark .cover__grid {
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  opacity: .16;
}

.shelf {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(.5rem, 1vw, .9rem);
  margin: var(--s-2) 0 var(--s-8);
}

.shelf .cover {
  padding: 14% 10%;
  box-shadow: 3px 3px 0 var(--ink);
}

.shelf .cover--dark {
  box-shadow: 3px 3px 0 var(--tint-2);
}

.shelf .cover__title {
  font-size: clamp(.62rem, .85vw, .82rem);
}

.shelf .cover__series {
  font-size: .42rem;
}

.shelf .cover__vol {
  font-family: var(--font-heading);
  font-synthesis: none;
  font-size: clamp(1rem, 1.5vw, 1.6rem);
  line-height: 1;
}

.series {
  border-top: 2px solid var(--ink);
}

.series li {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--rule);
}

.series .vol {
  font-family: var(--font-heading);
  font-synthesis: none;
  font-size: 1.15rem;
  line-height: 1.3;
}

.series .h-item {
  font-family: var(--font-subtitle);
  font-weight: 700;
  font-size: 1rem;
}

.series p {
  margin: 2px 0 6px;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.5;
}

.status {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink);
  background: var(--tint);
  padding: 2px 8px;
}

.status--strong {
  background: var(--cta);
  color: var(--paper);
}

/* ---- Chapter 2: our.ink -------------------------------------------------- */
.figure {
  margin: var(--s-8) 0 0;
}

.figure__frame {
  border: 1px solid var(--ink);
  background: var(--paper);
  overflow: hidden;
}

.figure__frame img {
  width: 100%;
  filter: grayscale(1) contrast(1.05);
  transition: filter 400ms var(--ease);
}

.figure:hover .figure__frame img,
.figure:focus-within .figure__frame img {
  filter: none;
}

.figure figcaption {
  font-size: var(--text-xs);
  color: var(--ink-2);
  margin-top: var(--s-3);
  line-height: 1.5;
  max-width: 60ch;
}

.figure figcaption b {
  font-weight: 600;
  color: var(--ink);
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: var(--s-8);
}

.features li {
  background: var(--tint);
  padding: var(--s-5);
}

.features p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.55;
}

.features--plain li {
  background: transparent;
  padding: var(--s-4) 0;
  border-top: 1px solid var(--rule);
}

.features--plain {
  gap: 0 var(--s-6);
}

.live {
  display: grid;
  gap: 2px;
}

.live a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-4);
  padding: var(--s-4) var(--s-5);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.live a:hover {
  background: #2b2a27;
}

.live a span:first-child {
  font-weight: 600;
}

.live a span:last-child {
  font-size: var(--text-sm);
  color: #d7d2ca;
  overflow-wrap: anywhere;
  text-align: right;
}

/* ---- Chapter 3: ReF.team ------------------------------------------------- */
.plate-inline {
  margin: var(--s-8) 0 0;
}

.plate-inline img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter 400ms var(--ease);
}

.plate-inline:hover img,
.plate-inline:focus-within img {
  filter: none;
}

.plate-inline figcaption {
  font-size: var(--text-xs);
  color: var(--ink-3);
  margin-top: var(--s-2);
}

.tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: var(--s-6);
}

.tracks div {
  background: var(--tint);
  padding: var(--s-5);
}

.tracks p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.55;
}

.workshops {
  border-top: 2px solid var(--ink);
  counter-reset: ws;
}

.workshops li {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.workshops .n {
  font-family: var(--font-heading);
  font-synthesis: none;
  font-size: 1.15rem;
}

.workshops p {
  margin: 2px 0 0;
  font-size: var(--text-sm);
  color: var(--ink-2);
  line-height: 1.5;
}

.workshops .dur {
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  background: var(--tint);
  padding: 3px 8px;
  letter-spacing: .02em;
}

.note {
  font-size: var(--text-sm);
  color: var(--ink-2);
  margin-top: var(--s-5);
}

/* ---- Chapter 4: work with us + contact ----------------------------------- */
.paths {
  display: grid;
  gap: 2px;
  margin-top: var(--s-2);
}

.paths li {
  background: var(--tint);
  padding: var(--s-6);
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: var(--s-3);
}

.paths .num {
  font-family: var(--font-heading);
  font-synthesis: none;
  font-size: 1.5rem;
  line-height: 1.1;
}

.paths p {
  margin: 0 0 var(--s-3);
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.form {
  display: grid;
  gap: var(--s-5);
  background: var(--tint);
  padding: clamp(1.25rem, 2.5vw, 2.25rem);
  border-top: 2px solid var(--ink);
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-5);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: .7rem .85rem;
  background: var(--paper);
  border: 1px solid #a8a198;
  border-radius: 2px;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23111110' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #8a1c1c;
  box-shadow: 0 0 0 1px #8a1c1c;
}

.field .err {
  font-size: var(--text-xs);
  color: #8a1c1c;
  min-height: 0;
}

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

.form__foot p {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--ink-3);
  max-width: 36ch;
}

.form-status {
  font-size: var(--text-sm);
  padding: var(--s-4) var(--s-5);
  background: var(--paper);
  border-left: 3px solid var(--ink);
}

.form-status[hidden] {
  display: none;
}

/* Cloudflare Turnstile: usually invisible; shows a check box only when
   Cloudflare wants the visitor to confirm */
.form__check:empty {
  display: none;
}

.form__foot p a {
  color: inherit;
}

.btn[disabled] {
  opacity: .6;
  cursor: progress;
}

/* ---- Colophon / footer --------------------------------------------------- */
.colophon {
  max-width: none;
  margin: 0;
  padding: clamp(3rem, 6vw, 6rem) clamp(1.25rem, 5vw, 5.75rem) var(--s-10);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  background: var(--paper);
  border-top: 1px solid var(--rule);
}

.colophon__device {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
}

.colophon__logo {
  width: clamp(84px, 8vw, 120px);
  aspect-ratio: 146 / 166;
  height: auto;
}

.colophon .colophon__name {
  font-size: 1.6rem;
  color: var(--ink);
  line-height: 1.1;
  margin: var(--s-3) 0 0;
}

.colophon .colophon__line {
  font-size: var(--text-xs);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}

.colophon__cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: var(--s-8);
  align-content: start;
}

.colophon__note p {
  max-width: 44ch;
}

.colophon__edition {
  font-size: var(--text-xs) !important;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3) !important;
}

.colophon h2 {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--s-3);
}

.colophon li {
  margin-bottom: var(--s-2);
}

.colophon a {
  font-size: var(--text-sm);
  text-decoration: none;
}

.colophon a:hover {
  text-decoration: underline;
}

.colophon p {
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.colophon__base {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-4);
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
  font-size: var(--text-xs);
  color: var(--ink-3);
}

/* ==========================================================================
   Tablet: one page (768–1199px)
   ========================================================================== */
@media (max-width: 1199px) {
  .spread {
    grid-template-columns: 1fr;
    max-width: 860px;
  }

  .spread::after {
    display: none;
  }

  .page {
    min-height: 0;
    background: var(--paper);
  }

  .page--verso {
    padding-bottom: var(--s-6);
  }

  .page--recto {
    padding-top: var(--s-6);
  }

  .page--verso .folio,
  .page--recto .runhead {
    display: none;
  }

  .page--recto .runhead {
    display: none;
  }

  .page--plate {
    min-height: 0;
    aspect-ratio: 16 / 9;
    padding: 0;
    order: 2;
  }

  .page--device {
    display: none;
  }

  .spread--opening .page--recto {
    order: 1;
    padding-top: calc(var(--page-pad-y) + 1.5rem);
    padding-bottom: var(--page-pad-y);
  }

  .spread--opening .page--recto .runhead {
    display: flex;
  }

  .spread--opening .page--recto .folio {
    display: none;
  }

  .page--plate figcaption {
    bottom: var(--s-4);
  }

  .title-page .h-display {
    max-width: 12ch;
  }

  .shelf {
    grid-template-columns: repeat(6, 1fr);
  }

  .nav a:not(.btn) {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

/* Navigation drawer (tablet + mobile) */
.menu-toggle {
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 .9rem;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
}

.menu-toggle svg {
  width: 16px;
  height: 16px;
}

.drawer {
  position: fixed;
  inset: var(--header-h) 0 auto 0;
  z-index: 49;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: var(--s-4) clamp(1rem, 3vw, 2.5rem) var(--s-6);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .25);
}

.drawer[hidden] {
  display: none;
}

.drawer ol {
  max-width: 860px;
  margin: 0 auto;
}

.drawer a {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: var(--s-3);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  font-family: var(--font-heading);
  font-synthesis: none;
  font-size: 1.5rem;
  line-height: 1.1;
}

.drawer a span {
  font-size: 1rem;
  color: var(--ink-3);
  padding-top: 4px;
}

/* ==========================================================================
   Mobile: one column (<768px)
   ========================================================================== */
@media (max-width: 767px) {
  :root {
    --page-pad-x: 1.25rem;
    --page-pad-y: 2.25rem;
    --header-h: 64px;
  }

  body {
    background: var(--paper);
  }

  .site-header {
    background: color-mix(in srgb, var(--paper) 92%, transparent);
  }

  .brand__name {
    font-size: 1.3rem;
  }

  .brand__mark {
    width: 30px;
    height: 34px;
  }

  .nav .btn {
    display: none;
  }

  .site-header__inner {
    gap: var(--s-3);
  }

  .brand {
    min-width: 0;
  }

  .brand__name {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .menu-toggle {
    padding: 0 .7rem;
  }
}

@media (max-width: 420px) {
  .menu-toggle__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .menu-toggle {
    width: 44px;
    justify-content: center;
    padding: 0;
  }

  .book {
    padding: 0;
  }

  .spread {
    box-shadow: none;
    margin: 0;
    border-top: 2px solid var(--ink);
    max-width: none;
  }

  .spread--opening {
    border-top: 0;
  }

  .runhead,
  .folio {
    display: none !important;
  }

  .page {
    padding: var(--page-pad-y) var(--page-pad-x);
  }

  .page--verso {
    padding-bottom: var(--s-4);
  }

  .page--recto {
    padding-top: var(--s-4);
  }

  .spread--opening .page--recto {
    padding-top: var(--s-8);
    padding-bottom: var(--s-8);
  }

  .page--plate {
    aspect-ratio: 4 / 3;
    padding: 0;
  }

  .h-display {
    font-size: clamp(2.75rem, 13vw, 3.75rem);
  }

  .actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .features,
  .tracks,
  .form__row {
    grid-template-columns: 1fr;
  }

  .features--plain {
    gap: 0;
  }

  .feature-book {
    grid-template-columns: 110px 1fr;
    gap: var(--s-4);
  }

  .shelf {
    grid-template-columns: repeat(3, 1fr);
    gap: .7rem;
  }

  .shelf .cover__title {
    font-size: .8rem;
  }

  .workshops li {
    grid-template-columns: 2rem 1fr;
  }

  .workshops .dur {
    grid-column: 2;
    justify-self: start;
    margin-top: 6px;
  }

  .toc a {
    grid-template-columns: 2rem 1fr;
  }

  .toc .toc__p {
    display: none;
  }

  .live a {
    flex-direction: column;
    gap: 2px;
  }

  .live a span:last-child {
    text-align: left;
  }

  .colophon {
    grid-template-columns: 1fr 1fr;
    background: var(--tint);
    border-top: 2px solid var(--ink);
    padding-left: var(--page-pad-x);
    padding-right: var(--page-pad-x);
  }

  .colophon> :first-child {
    grid-column: 1 / -1;
  }
}

/* Touch screens cannot hover: show images in colour all the time. */
@media (hover: none),
(max-width: 1199px) {

  .figure__frame img,
  .plate-inline img,
  .book-cover img,
  .cover--image img {
    filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

@media print {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .site-header,
  .drawer,
  .form {
    display: none;
  }

  body {
    background: #fff;
  }

  .spread {
    box-shadow: none;
    break-inside: avoid;
  }
}

a.status--strong {
  text-decoration: none;
}

a.status--strong:hover {
  background: var(--cta-hover);
}

.accent {
  color: var(--teal);
}

/* Faint GAP logo watermark on the grey desk */
body {
  background-image: url("../img/gap-watermark.svg");
  background-size: 240px 240px;
  background-attachment: fixed;
}

@media (max-width: 767px) {
  body {
    background-image: none;
  }
}

/* ==========================================================================
   Finishing details
   ========================================================================== */
/* Spaced capitals for labels (no true small caps in Inter/Comfortaa) */
.label {
  letter-spacing: .14em;
}

/* One accent: a teal hairline under each chapter label */
.label--chapter {
  align-self: flex-start;
  padding-bottom: var(--s-2);
  margin-bottom: var(--s-5);
  border-bottom: 1px solid var(--teal);
}

/* Aligned figures */
.status,
.workshops .dur,
.toc__p,
.folio,
.series p,
.form {
  font-variant-numeric: lining-nums tabular-nums;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* Large faint chapter numeral in the top corner of each chapter's left page */
.page--verso[data-chapter] {
  isolation: isolate;
  overflow: hidden;
}

.page--verso[data-chapter]::before {
  content: attr(data-chapter);
  position: absolute;
  z-index: -1;
  top: calc(var(--page-pad-y) + 1.75rem);
  right: calc(var(--page-pad-x) * 0.6);
  font-family: var(--font-heading);
  font-synthesis: none;
  font-weight: 400;
  font-size: clamp(9rem, 15vw, 15rem);
  line-height: .8;
  color: var(--ink);
  opacity: .045;
  pointer-events: none;
}

/* Covers lift slightly on hover */
.book-cover,
.shelf .cover {
  transition: transform 500ms var(--ease), box-shadow 500ms var(--ease);
  transform-origin: left center;
}

@media (hover: hover) {

  .book-cover:hover,
  .shelf .cover:hover {
    transform: perspective(900px) rotateY(-8deg) translateY(-3px);
  }
}

/* Spreads rise gently into view (only when JS runs and motion is allowed) */
@media (prefers-reduced-motion: no-preference) {
  html.motion .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 900ms var(--ease), transform 900ms var(--ease);
  }

  html.motion .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 767px) {
  .page--verso[data-chapter]::before {
    font-size: 7.5rem;
    top: var(--s-6);
    right: var(--page-pad-x);
  }

  .colophon {
    grid-template-columns: 1fr;
    background: var(--paper);
  }

  .colophon__cols {
    grid-template-columns: 1fr 1fr;
  }

  .colophon__note {
    grid-column: 1 / -1;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .colophon {
    grid-template-columns: 1fr;
  }
}

/* Our.ink spread only */
.ourink-page .page__body>p {
  margin-block: 0 0.75rem;
  line-height: 1.45;
}

.ourink-page .page__body>.subtitle {
  margin-bottom: 1rem;
  line-height: 1.3;
}

/* Section headings */
.ourink-page .h-sub {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.ourink-page .features+.h-sub {
  margin-top: 1.1rem;
}

/* Feature grids */
.ourink-page .features {
  margin-block: 0;
}

.ourink-page .features>li {
  padding: 0.65rem 0.75rem;
}

.ourink-page .features .h-item {
  margin: 0 0 0.25rem;
  line-height: 1.25;
}

.ourink-page .features p {
  margin: 0;
  line-height: 1.4;
}

/* Reader features: retain the lighter layout */
.ourink-page .features--plain {
  column-gap: 1rem;
  row-gap: 0;
}

.ourink-page .features--plain>li {
  padding: 0.6rem 0;
}

/* Reader example and caption */
.ourink-page figure {
  margin-block: 1rem 0;
}

.ourink-page figcaption {
  margin-top: 0.35rem;
  line-height: 1.35;
}

/* Compact carousel beneath the example */

/* Do not push the action buttons away from the content */
.ourink-page .push-end {
  margin-top: 1rem;
}

.ourink-page .actions {
  margin-top: 0;
}

.innovation-series-page .shelf {
  margin-block: 1.25rem;
}

.innovation-series-page__summary {
  margin: 0;
  line-height: 1.45;
}

/* Three books across, two rows */
.innovation-series-page .series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.innovation-series-page .series-grid__item {
  align-items: flex-start;
  min-width: 0;
}

/* Larger covers with explicitly controlled layout */
.innovation-series-page .series-grid .cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  box-sizing: border-box;
  flex: none;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
  padding: 0.7rem 0.6rem;
  color: #000;
  background: #fff;
  border: 1px solid #222;
  box-shadow: 3px 3px 0 #222;
  overflow: hidden;
}

/* Volume number near the top */
.innovation-series-page .series-grid .cover__vol {
  position: static;
  display: block;
  margin: 0;
  padding: 0;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  transform: none;
}

/* Title near the bottom */
.innovation-series-page .series-grid .cover__title {
  position: static;
  display: block;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  transform: none;
}

/* Illustrated cover */
.innovation-series-page .series-grid .cover--image {
  display: block;
  padding: 0;
}

.innovation-series-page .series-grid .cover--image img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
}

/* Short description beneath each book */
.innovation-series-page .series-grid__description {
  margin: 0.8rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

/* Two columns on narrow screens */
@media (max-width: 480px) {
  .innovation-series-page .series-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.25rem;
    row-gap: 1.5rem;
  }
}

/* Innovation series: keep cover artwork in full colour at all times */
#innovation-professional .cover,
#innovation-professional .cover img,
#innovation-professional .cover:hover,
#innovation-professional .cover:hover img,
#innovation-professional img[src*="innovation-illustrated-cover"] {
  filter: none !important;
  -webkit-filter: none !important;
  opacity: 1;
  mix-blend-mode: normal;
}

/* Reduce the gap between the introduction and the book grid */
.innovation-series-page .series-grid {
  margin-top: 1rem;
  margin-bottom: 1rem;
  column-gap: 1rem;
  row-gap: 1.25rem;
}

/* Keep each item's contents together */
.innovation-series-page .series-grid__item {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

/* Remove heading margins, retaining equal-height title areas */
.innovation-series-page .series-grid__heading {
  margin: 0;
  min-height: 2.7em;
  font-size: 0.85rem;
  line-height: 1.35;
}

/* Remove any inherited margin around the covers */
.innovation-series-page .series-grid .cover {
  margin: 0;
}

/* Keep the button close to the grid */
.innovation-series-page .actions {
  margin-top: 0.75rem;
}

/* Full available width, without a fixed crop */
figure.workshop-plate {
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  margin-inline: 0;
  box-sizing: border-box;
}

/* Preserve the image's natural proportions */
figure.workshop-plate>img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain;
  object-position: center;
}

/* Always retain the artwork's original colours */
figure.workshop-plate,
figure.workshop-plate:hover,
figure.workshop-plate>img,
figure.workshop-plate:hover>img {
  filter: none !important;
  -webkit-filter: none !important;
  opacity: 1;
  mix-blend-mode: normal;
}

/* Our.ink reader image: always display in colour */
#our-ink .figure__frame img {
  filter: none;
}