/* Longbeard Consulting: the Field Guide.
   Plum bookcloth covers, ivory plate pages, olive as the second field,
   ochre only on things you can act on. */

@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-var.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya"; src: url("../fonts/alegreya-italic-var.woff2") format("woff2"); font-weight: 400 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("../fonts/alegreya-sans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Alegreya Sans SC"; src: url("../fonts/alegreya-sans-sc-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;

  /* Bookcloth and plates */
  --plum: #5B2E4F;
  --plum-deep: #3E1F36;
  --plum-ink: #2A1626;
  --ivory: #F2EDE2;
  --ivory-shade: #E7E0D1;
  --olive: #6B7A3E;
  --olive-field: #56632F; /* olive deep enough to carry ivory text */
  --olive-ink: #4A5527;
  --ochre: #D4A21E;
  --ochre-deep: #A87E10;

  /* Text on each ground */
  --on-plum: #F2EDE2;
  --on-plum-muted: #EBC9DF;
  --on-ivory: #2A1626;
  --on-ivory-muted: #5E4E58;
  --rule-plum: #7A4E6E;
  --rule-ivory: #CFC5B3;

  /* Type */
  --display: "Alegreya", Georgia, "Times New Roman", serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --label: "Alegreya Sans SC", "Alegreya Sans", "Segoe UI", system-ui, sans-serif;

  --step--1: clamp(0.9rem, 0.86rem + 0.15vw, 0.98rem);
  --step-0: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  --step-1: clamp(1.3rem, 1.18rem + 0.5vw, 1.6rem);
  --step-2: clamp(1.7rem, 1.45rem + 1vw, 2.3rem);
  --step-3: clamp(2.6rem, 2rem + 2.6vw, 4.6rem);

  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --space: clamp(1rem, 0.8rem + 1vw, 1.6rem);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--plum) var(--ivory-shade); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--on-ivory);
  font: 400 var(--step-0)/1.55 var(--body);
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ochre); color: var(--plum-ink); }
/* focus rings take the colour that holds 3:1 on each ground */
:focus-visible { outline: 3px solid var(--plum-ink); outline-offset: 3px; border-radius: 2px; }
.verso :focus-visible, .cover :focus-visible, .colophon :focus-visible { outline-color: var(--ochre); }
.engage :focus-visible { outline-color: var(--ivory); }
a { color: inherit; text-decoration-color: var(--ochre-deep); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--ochre); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; text-wrap: balance; margin: 0; }
p { margin: 0; max-width: 66ch; }
.num { font-variant-numeric: tabular-nums lining-nums; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ochre); color: var(--plum-ink); padding: 0.6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- The opening spread ---------- */

.spread { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); min-height: min(100svh, 980px); }

.verso, .recto { display: flex; flex-direction: column; gap: clamp(1.4rem, 1rem + 1.4vw, 2.4rem); padding-block: clamp(1.4rem, 1rem + 1.5vw, 2.6rem) clamp(2rem, 1.5rem + 2vw, 3.4rem); }

.verso {
  background: var(--plum);
  color: var(--on-plum);
  padding-left: max(clamp(1.4rem, 0.5rem + 3.6vw, 4.6rem), var(--gutter));
  padding-right: clamp(1.4rem, 0.5rem + 3vw, 4rem);
  position: relative;
}

.recto {
  background: var(--ivory);
  padding-left: clamp(1.4rem, 0.5rem + 3vw, 4rem);
  padding-right: max(clamp(1.4rem, 0.5rem + 3.6vw, 4.6rem), var(--gutter-r));
}

/* Running heads double as navigation */
.running { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font: 500 var(--step--1)/1.2 var(--label); letter-spacing: 0.05em; }
.verso .running { color: var(--on-plum-muted); border-bottom: 1px solid var(--rule-plum); padding-bottom: 0.7rem; }
.recto .running { color: var(--on-ivory-muted); border-bottom: 1px solid var(--rule-ivory); padding-bottom: 0.7rem; }
.running a { text-decoration: none; }
.running a:hover { color: inherit; text-decoration: underline; text-decoration-color: var(--ochre); }
.brand { color: var(--on-plum); font-size: var(--step-0); letter-spacing: 0.04em; }
.recto .running { justify-content: flex-end; }
.nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-block; padding-block: 0.35rem; color: var(--on-ivory); }
.verso .nav { display: none; }
.verso .nav a { color: var(--on-plum); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--ochre-deep); }

.title { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.015em; margin-top: clamp(0.25rem, 1vw, 1rem); }
.title em { display: block; font-style: normal; font-weight: 500; color: var(--on-plum-muted); }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--on-plum-muted); max-width: 32ch; }

/* Identified problems */
.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-plum); }
.entry { position: relative; border-bottom: 1px solid var(--rule-plum); }
.entry a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.15rem 0.9rem; padding: 0.95rem 0; text-decoration: none; }
.entry h2 { font-size: var(--step-1); font-weight: 600; }
.entry .mark { color: var(--on-plum-muted); font-size: var(--step--1); display: flex; align-items: center; gap: 0.6rem; }
/* the field-mark leader line draws in on hover or focus */
.entry .mark::before { content: ""; flex: 0 0 auto; height: 1px; width: 0.9rem; background: var(--on-plum-muted); transition: width 420ms cubic-bezier(0.16, 1, 0.3, 1), background-color 420ms; }
.entry a:hover .mark::before, .entry a:focus-visible .mark::before { width: 2.6rem; background: var(--ochre); }
.entry a:hover h2, .entry a:focus-visible h2 { text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }

.act { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; margin-top: auto; }
.button { display: inline-block; background: var(--ochre); color: var(--plum-ink); font: 700 var(--step-0)/1.2 var(--body); padding: 0.9rem 1.3rem; border-radius: 2px; text-decoration: none; box-shadow: 0 1px 0 var(--ochre-deep), 0 6px 16px -8px rgba(20, 8, 16, 0.55); transition: background-color 200ms, transform 200ms; }
.button:hover { background: #E2B23A; transform: translateY(-1px); }
.act .note { color: var(--on-plum-muted); font-size: var(--step--1); }

/* ---------- Plates ---------- */

.plate-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 0.8rem 1.6rem; border-bottom: 2px solid var(--on-ivory); padding-bottom: 0.8rem; }
.plate-head h2 { font-size: var(--step-2); font-weight: 700; }
.plate-head h2 .plate-label { display: inline-block; font: 500 var(--step--1)/1 var(--label); letter-spacing: 0.05em; color: var(--on-ivory-muted); margin-right: 0.6rem; vertical-align: 0.35em; }
.plate-head h2 .sub { font-weight: 500; font-style: italic; color: var(--on-ivory-muted); }
.plate-body { display: flex; flex-direction: column; gap: 0.9rem; }


.specimens { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(0.9rem, 0.5rem + 0.9vw, 1.4rem); }
.specimen a { display: flex; flex-direction: column; gap: 0.6rem; text-decoration: none; height: 100%; }
.figure { aspect-ratio: 3 / 2; background: var(--ivory-shade); border: 1px solid var(--rule-ivory); display: grid; place-items: center; position: relative; }
.figure svg { width: 30%; height: auto; }
.figure .tag { position: absolute; top: 0.75rem; left: 0.8rem; font: 500 var(--step--1)/1 var(--label); letter-spacing: 0.05em; color: var(--on-ivory-muted); font-variant-numeric: tabular-nums lining-nums; }
.specimen a:hover .figure { border-color: var(--ochre-deep); box-shadow: 0 10px 22px -16px rgba(42, 22, 38, 0.6); }
.cap { display: flex; flex-direction: column; gap: 0.1rem; }
.cap-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.cap h3 { font: italic 600 var(--step-1)/1.15 var(--display); }
.specimen a:hover .cap h3 { text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 2px; }
.cap .fact { font-size: var(--step--1); color: var(--on-ivory-muted); white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; text-align: right; }
.cap .platforms { font-size: var(--step--1); color: var(--on-ivory-muted); }
.plate-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1.4rem; align-items: baseline; margin-top: auto; }
.plate-foot a { font-weight: 500; }

/* ---------- Accounts below the spread ---------- */

.section { padding-block: clamp(3rem, 2rem + 4vw, 6rem); padding-left: max(clamp(1.4rem, 0.5rem + 5vw, 7rem), var(--gutter)); padding-right: max(clamp(1.4rem, 0.5rem + 5vw, 7rem), var(--gutter-r)); }
.section > h2 { font-size: var(--step-2); margin-bottom: clamp(1.4rem, 1rem + 1vw, 2.2rem); }

.accounts { display: grid; gap: clamp(2rem, 1.4rem + 2vw, 3.4rem); }
.section > h2 .plate-label { display: inline-block; font: 500 var(--step--1)/1 var(--label); letter-spacing: 0.05em; color: var(--on-ivory-muted); margin-right: 0.6rem; vertical-align: 0.3em; }
.account { border-top: 2px solid var(--plum); padding-top: 1.2rem; scroll-margin-top: 1.5rem; max-width: 72rem; }
.account h3 { font-size: var(--step-2); margin-bottom: 0.8rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.9rem; }
.account .account-body { padding-left: clamp(0rem, 6vw, 5.4rem); }
.account p + p { margin-top: 0.8rem; }

.engage { background: var(--olive-field); color: var(--ivory); }
.engage > h2 { color: var(--ivory); }
.engage-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.6rem, 1rem + 3vw, 4.4rem); align-items: start; }
.engage p { color: var(--ivory); }
.engage p + p { margin-top: 0.9rem; }
.engage ol { margin: 0; padding-left: 1.3rem; display: grid; gap: 0.6rem; }
.engage ol li::marker { font-family: var(--display); font-weight: 700; color: var(--ivory); }
.engage .button { margin-top: 1.4rem; }
.engage strong { color: var(--ivory); }

.author { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr); gap: clamp(1.2rem, 1rem + 2vw, 3rem); align-items: start; }
.author figure { margin: 0; max-width: 11rem; }
/* the cameo is mounted like a catalogue figure: ivory mat, hairline frame */
.author .mat { background: #FBF8F1; border: 1px solid var(--rule-ivory); padding: 0.7rem; box-shadow: 0 8px 18px -14px rgba(42, 22, 38, 0.55); }
.author img { border: 1px solid var(--on-ivory-muted); }
.author figcaption { font-size: var(--step--1); color: var(--on-ivory-muted); margin-top: 0.6rem; }
.author figcaption b { font: 500 var(--step--1)/1 var(--label); letter-spacing: 0.05em; color: var(--on-ivory); margin-right: 0.3rem; }
.author h2 + p { margin-top: 0.9rem; }
.author p + p { margin-top: 0.8rem; }

/* ---------- Inner pages: a plum cover over ivory plates ---------- */

.cover { background: var(--plum); color: var(--on-plum); display: flex; flex-direction: column; gap: clamp(1.8rem, 1.2rem + 2.4vw, 3.6rem); padding-block: clamp(1.4rem, 1rem + 1.5vw, 2.6rem); padding-left: max(clamp(1.4rem, 0.5rem + 5vw, 7rem), var(--gutter)); padding-right: max(clamp(1.4rem, 0.5rem + 5vw, 7rem), var(--gutter-r)); }
.cover .running { flex-wrap: wrap; color: var(--on-plum-muted); border-bottom: 1px solid var(--rule-plum); padding-bottom: 0.7rem; }
.cover .nav a { color: var(--on-plum); }
.cover-title { display: grid; gap: 0.9rem; }
.cover .title { margin: 0; }
.cover .lede { max-width: 46ch; }
.cover .updated { color: var(--on-plum-muted); font: 500 var(--step--1)/1.3 var(--label); letter-spacing: 0.05em; }
.subnav { border-top: 1px solid var(--rule-plum); padding-top: 0.7rem; font: 500 var(--step--1)/1.2 var(--label); letter-spacing: 0.05em; }
.subnav a { display: inline-block; padding-block: 0.35rem; text-decoration: none; }
.subnav a:hover { text-decoration: underline; text-decoration-color: var(--ochre); }
.cover .nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--ochre); }

/* Running text: policies, support, the Now page */
.doc h2 { font-size: var(--step-1); font-weight: 600; margin-top: clamp(2rem, 1.6rem + 1.4vw, 3rem); margin-bottom: 0.6rem; }
.doc h2:first-child { margin-top: 0; }
.doc ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.6rem; }
.doc li::marker { color: var(--plum); }
.facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.4rem 1.4rem; }
.facts dt { font: 500 var(--step--1)/1.7 var(--label); letter-spacing: 0.05em; color: var(--on-ivory-muted); }
.facts dd { margin: 0; }
.engage > .button { margin-top: 0; }
.engage-grid .button:only-child { margin-top: 0; }

/* The ledger of builds */
.builds, .policies { list-style: none; margin: 0; padding: 0; }
.build { display: grid; grid-template-columns: minmax(8rem, 15rem) minmax(0, 1fr); gap: clamp(1.2rem, 1rem + 2vw, 3rem); align-items: start; padding-block: clamp(1.6rem, 1.2rem + 1.4vw, 2.6rem); border-bottom: 1px solid var(--rule-ivory); scroll-margin-top: 1rem; }
.build-solo { padding-block: 0; border-bottom: 0; align-items: center; }
.build:target .figure { border-color: var(--ochre-deep); }
.build-body { display: grid; gap: 0.5rem; }
.build h3 { font: italic 600 var(--step-2)/1.1 var(--display); }
.build .cap-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.build .fact, .build .platforms { font-size: var(--step--1); color: var(--on-ivory-muted); font-variant-numeric: tabular-nums lining-nums; }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.4rem; font-weight: 500; }
.links a { display: inline-block; padding-block: 0.55rem; }
.policy { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.2rem 2rem; padding-block: 1.1rem; border-bottom: 1px solid var(--rule-ivory); }
.policy h3 { font: italic 600 var(--step-1)/1.15 var(--display); }
.policy .where { display: block; font-size: var(--step--1); color: var(--on-ivory-muted); }

/* ---------- Colophon ---------- */

.colophon { background: var(--plum-ink); color: var(--on-plum-muted); padding-block: 2.4rem; padding-left: max(clamp(1.4rem, 0.5rem + 5vw, 7rem), var(--gutter)); padding-right: max(clamp(1.4rem, 0.5rem + 5vw, 7rem), var(--gutter-r)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; font-size: var(--step--1); }
.colophon a { display: inline-block; padding-block: 0.35rem; color: var(--on-plum); }
.colophon ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; }

/* ---------- Narrow screens: the spread becomes pages read in order ---------- */

@media (max-width: 960px) {
  .spread { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .verso, .recto { padding-left: max(1.4rem, var(--gutter)); padding-right: max(1.4rem, var(--gutter-r)); }
  .author, .engage-grid { grid-template-columns: minmax(0, 1fr); }
  .account .account-body { padding-left: 0; }
  /* the site nav moves into the first page so phones see it first */
  .verso .running { flex-wrap: wrap; }
  .verso .nav { display: flex; width: 100%; padding-top: 0.6rem; border-top: 1px solid var(--rule-plum); }
  .recto .running { display: none; }
}
@media (max-width: 520px) {
  .running { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .figure .tag { font-size: 0.78rem; }
  .build { grid-template-columns: minmax(0, 1fr); }
  .build .figure { aspect-ratio: 5 / 2; }
  .build .figure svg { width: auto; height: 60%; }
  .policy { flex-direction: column; align-items: flex-start; }
}
