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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  background: #F3F4EE;
  color: #242A1E;
  font-family: "PT Serif", serif;
  font-size: 18px;
  line-height: 1.72;
  font-weight: 400;
}

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

a {
  color: #5C7A38;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: #242A1E;
}

:focus-visible {
  outline: 2px solid #5C7A38;
  outline-offset: 3px;
}

h1, h2, h3, h4,
.tagstrip, .h-large, .h-tick,
.rail__name, .rail__link, .rail__meta,
.btn, .cover__tag,
.card__no, .card__title, .card__meta,
.loopdiagram__no, .pullbox,
.matrix th, .matrix caption,
.sitefoot, .enquiry label,
.qa__q, .cookiebar {
  font-family: "Poppins", sans-serif;
}

h1, h2, h3, h4 {
  color: #242A1E;
  margin: 0 0 0.7em;
  line-height: 1.15;
}

h1 {
  font-weight: 600;
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  letter-spacing: -0.015em;
  line-height: 1.08;
}

h2 {
  font-weight: 600;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
}

h3 {
  font-weight: 500;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1em; padding-left: 1.2em; }

.tagstrip {
  font-weight: 500;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #7F856F;
  margin: 0 0 0.65rem;
}

.h-large {
  font-weight: 600;
  font-size: 2.6rem;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0.2em 0 0.55em;
}

.h-tick {
  display: block;
  font-weight: 500;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5C7A38;
  margin: 0 0 0.35rem;
}

.dropcap::first-letter {
  font-family: "PT Serif", serif;
  font-weight: 700;
  float: left;
  font-size: 3.4em;
  line-height: 0.82;
  margin: 0.04em 0.12em 0 0;
  color: #5C7A38;
}

/* Rail */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: start;
  grid-column: 1;
  grid-row: 1 / -1;
  background: #E4E7DA;
  border-right: 1px solid #7F856F55;
  padding: 1.45rem 1.15rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  overflow-y: auto;
  z-index: 5;
}

.rail__mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.rail__mark svg {
  display: block;
  width: 34px;
  height: 34px;
}

.rail__name {
  font-weight: 600;
  font-size: 1.02rem;
  color: #242A1E;
  line-height: 1.25;
  margin: 0;
}

.rail__name span {
  display: block;
  font-weight: 500;
  font-size: 0.74rem;
  color: #7F856F;
  letter-spacing: 0;
  margin-top: 0.28rem;
  font-family: "Poppins", sans-serif;
}

.rail__nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0.2rem 0 auto;
}

.rail__link {
  color: #242A1E;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.3;
  padding: 0.12rem 0 0.12rem 0.7rem;
  border-left: 3px solid transparent;
}

.rail__link:hover {
  color: #5C7A38;
}

.rail__link.is-here {
  font-weight: 600;
  color: #242A1E;
  border-left-color: #5C7A38;
}

.rail__meta {
  font-size: 0.875rem;
  line-height: 1.55;
  color: #7F856F;
  font-weight: 500;
}

.rail__meta a {
  color: #7F856F;
  text-decoration: none;
}

.rail__meta a:hover { color: #242A1E; }

/* Main column */
.page {
  --page-pad: clamp(1.5rem, 4vw, 4.5rem);
  grid-column: 2;
  padding: var(--page-pad);
  padding-bottom: 2.2rem;
  min-width: 0;
}

.page > section,
.page > .masthead,
.page > .closer {
  max-width: 1180px;
}

.page > section + section,
.page > .masthead + section {
  margin-top: clamp(2.4rem, 4vw, 3.8rem);
}

section {
  scroll-margin-top: 1rem;
}

/* Cover */
.cover {
  position: relative;
  min-height: 44vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: #F3F4EE;
  margin: calc(var(--page-pad) * -1) calc(var(--page-pad) * -1) clamp(2rem, 3.5vw, 3.2rem);
  width: calc(100% + 2 * var(--page-pad));
  max-width: none;
}

.is-home .cover { min-height: 58vh; }

.cover__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(36, 42, 30, 0.88) 0%, rgba(36, 42, 30, 0.66) 55%, rgba(36, 42, 30, 0.45) 100%);
}

.cover__text {
  position: relative;
  z-index: 1;
  max-width: 44rem;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  color: #F3F4EE;
}

.cover__text h1 { color: #F3F4EE; margin-bottom: 0.45em; }

.cover__tag {
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #C9D3B4;
  margin: 0 0 0.7rem;
}

.cover__lede {
  font-family: "PT Serif", serif;
  font-size: 1.12rem;
  line-height: 1.55;
  color: #F3F4EE;
  margin: 0 0 1.25rem;
  max-width: 40rem;
}

.cover__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

.cover a:not(.btn) { color: #C9D3B4; }
.cover a:not(.btn):hover { color: #F3F4EE; }

/* Masthead (no photo) */
.masthead {
  max-width: 44rem;
  padding-bottom: 0.4rem;
}

.masthead h1 { margin-bottom: 0.4em; }

.masthead .lede {
  font-size: 1.12rem;
  max-width: 62ch;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.62rem 1.15rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}

.btn:hover { text-decoration: none; }

.btn--solid {
  background: #242A1E;
  color: #F3F4EE;
}

.btn--solid:hover {
  background: #1A1F16;
  color: #F3F4EE;
}

.btn--moss {
  background: #5C7A38;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 16px;
}

.btn--moss:hover {
  background: #47612B;
  color: #FFFFFF;
}

.btn--quiet {
  background: #E4E7DA;
  color: #242A1E;
  border-color: #7F856F;
}

.btn--quiet:hover {
  background: #D6DBC8;
  color: #242A1E;
}

.acts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.1rem 0 0;
}

/* Editorial furniture */
.spread {
  display: grid;
  grid-template-columns: 0.65fr 1.35fr;
  gap: clamp(1.5rem, 3.2vw, 3.4rem);
  align-items: start;
}

.spread__side { min-width: 0; }

.spread__body { min-width: 0; }

.spread__body > p,
.spread__body > .pullbox,
.longread > p {
  max-width: 68ch;
}

.colset {
  columns: 2;
  column-gap: 2.4rem;
  column-rule: 1px solid #7F856F33;
}

.colset > p {
  margin-bottom: 1em;
  max-width: none;
}

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

.pullbox {
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.45;
  background: #E4E7DA;
  border-left: 3px solid #5C7A38;
  padding: 1.1rem 1.4rem;
  margin: 1.2rem 0;
  color: #242A1E;
}

.marginal {
  font-family: "PT Serif", serif;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #7F856F;
  margin: 0.6rem 0 0;
}

.ruleline {
  display: block;
  height: 4px;
  border: 0;
  margin: 0 0 1.4rem;
  background:
    linear-gradient(#5C7A38, #5C7A38) left center / 28px 4px no-repeat,
    linear-gradient(#5C7A38, #5C7A38) left center / 100% 1px no-repeat;
}

/* Cards */
.cardgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.card {
  background: #E4E7DA;
  padding: 1.25rem 1.3rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.card__no {
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5C7A38;
  margin: 0;
}

.card__title {
  font-weight: 600;
  font-size: 1.12rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.card__body {
  font-family: "PT Serif", serif;
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  flex: 1;
}

.card__meta {
  font-weight: 500;
  font-size: 0.875rem;
  color: #7F856F;
  margin: 0.4rem 0 0;
  letter-spacing: 0.02em;
}

.card a.card__title {
  color: #242A1E;
  text-decoration: none;
}

.card a.card__title:hover { color: #5C7A38; }

/* Tables */
.matrix-scroll {
  overflow-x: auto;
  margin: 1rem 0 0;
  -webkit-overflow-scrolling: touch;
}

.matrix {
  width: 100%;
  border-collapse: collapse;
  background: #E4E7DA;
  font-size: 0.98rem;
}

.matrix caption {
  caption-side: top;
  text-align: left;
  font-weight: 500;
  font-size: 0.85rem;
  color: #7F856F;
  padding: 0 0 0.55rem;
}

.matrix th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7F856F;
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #7F856F55;
  vertical-align: bottom;
  background: #E4E7DA;
}

.matrix td {
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid #7F856F55;
  vertical-align: top;
  color: #242A1E;
}

.matrix tbody tr:last-child td { border-bottom: 0; }

.matrix td.num,
.matrix th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.matrix--compact th,
.matrix--compact td {
  padding: 0.5rem 0.7rem;
  font-size: 0.92rem;
}

/* Loop diagram */
.loopdiagram {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
  margin: 1.2rem 0;
}

.loopdiagram__pass {
  position: relative;
  background: #E4E7DA;
  padding: 1.15rem 1.15rem 1.25rem;
}

.loopdiagram__no {
  display: block;
  font-weight: 600;
  font-size: 2.4rem;
  line-height: 1;
  color: #5C7A38;
  letter-spacing: -0.03em;
  margin-bottom: 0.45rem;
}

.loopdiagram__pass h3 {
  margin: 0 0 0.35em;
  font-size: 1.05rem;
}

.loopdiagram__pass p {
  font-size: 0.98rem;
  margin: 0;
}

.loopdiagram__pass:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -0.72rem;
  top: 42%;
  width: 10px;
  height: 10px;
  border-right: 2px solid #5C7A38;
  border-top: 2px solid #5C7A38;
  transform: rotate(45deg);
}

/* Ladder */
.ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ladder__rung {
  background: #E4E7DA;
  padding: 0.85rem 1.1rem;
  border-left: 4px solid #5C7A38;
}

.ladder__rung p { margin: 0; font-size: 0.98rem; }

.ladder__rung:nth-child(1) { margin-left: 0; border-left-width: 4px; }
.ladder__rung:nth-child(2) { margin-left: 0.7rem; border-left-width: 7px; }
.ladder__rung:nth-child(3) { margin-left: 1.4rem; border-left-width: 10px; }
.ladder__rung:nth-child(4) { margin-left: 2.1rem; border-left-width: 13px; }
.ladder__rung:nth-child(5) { margin-left: 2.8rem; border-left-width: 16px; }

/* Rails */
.railsbox {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
}

.railsbox__item {
  background: #E4E7DA;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid #5C7A38;
  font-size: 1.02rem;
}

.railsbox__item strong {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  color: #5C7A38;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  margin-right: 0.35rem;
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  background: #E4E7DA;
}

.timeline__slot {
  display: grid;
  grid-template-columns: 5.6rem 1fr;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid #7F856F55;
  align-items: start;
}

.timeline__slot:last-child { border-bottom: 0; }

.timeline__slot .when {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  color: #5C7A38;
  font-variant-numeric: tabular-nums;
}

.timeline__slot h3 {
  margin: 0 0 0.2em;
  font-size: 1.05rem;
}

.timeline__slot p { margin: 0; font-size: 1rem; }

/* Figures */
.figblock {
  margin: 1.1rem 0 0;
}

.figblock img {
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 420px;
}

.figblock__cap {
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: #7F856F;
  margin: 0.5rem 0 0;
  letter-spacing: 0.02em;
}

/* Q&A */
.qa {
  background: #E4E7DA;
  padding: 1.15rem 1.25rem 1.25rem;
  margin: 0 0 0.75rem;
}

.qa__q {
  margin: 0 0 0.4em;
  font-size: 1.12rem;
}

.qa__a {
  margin: 0;
  font-family: "PT Serif", serif;
  max-width: 68ch;
}

/* Enquiry */
.enquiry {
  display: grid;
  gap: 0.95rem;
  max-width: 38rem;
  background: #E4E7DA;
  padding: 1.35rem 1.4rem 1.5rem;
}

.enquiry__field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.enquiry__field label {
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7F856F;
}

.enquiry input,
.enquiry select,
.enquiry textarea {
  font-family: "PT Serif", serif;
  font-size: 1.05rem;
  color: #242A1E;
  background: #F3F4EE;
  border: 1px solid #7F856F;
  padding: 0.55rem 0.7rem;
  width: 100%;
}

.enquiry textarea { min-height: 9rem; resize: vertical; }

code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.9em;
  color: #242A1E;
  font-weight: 700;
}

.enquiry__note {
  font-size: 0.9rem;
  color: #7F856F;
  font-style: italic;
  font-family: "PT Serif", serif;
  margin: 0;
}

.enquiry .hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alertbar {
  padding: 0.9rem 1.15rem;
  margin: 0 0 1.2rem;
  max-width: 42rem;
  background: #E4E7DA;
}

.alertbar--ok { border-left: 3px solid #5C7A38; }
.alertbar--warn { border-left: 3px solid #242A1E; }

/* Footer */
.sitefoot {
  grid-column: 2;
  max-width: none;
  margin: 0;
  padding: 1.15rem clamp(1.5rem, 4vw, 4.5rem) 2.6rem;
  font-weight: 500;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #7F856F;
  overflow-wrap: anywhere;
  background:
    linear-gradient(#5C7A38, #5C7A38) clamp(1.5rem, 4vw, 4.5rem) top / 28px 4px no-repeat,
    linear-gradient(#5C7A38, #5C7A38) clamp(1.5rem, 4vw, 4.5rem) top / calc(100% - 2 * clamp(1.5rem, 4vw, 4.5rem)) 1px no-repeat;
}

html:not(.cookie-dismissed) .sitefoot {
  padding-bottom: 7rem;
}

.sitefoot a {
  color: #7F856F;
  text-underline-offset: 3px;
}

.sitefoot a:hover { color: #242A1E; }

/* Cookie bar */
.cookiebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: #E4E7DA;
  border-top: 1px solid #7F856F55;
  padding: 0.95rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.cookiebar[hidden] { display: none !important; }

.cookiebar__text {
  margin: 0;
  font-family: "PT Serif", serif;
  font-size: 0.95rem;
  color: #242A1E;
  max-width: 62ch;
}

.cookiebar__acts {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Motion */
.lift-in {
  opacity: 1;
  transform: none;
  transition: opacity 420ms ease-out, transform 420ms ease-out;
}

html.js .lift-in {
  opacity: 0;
  transform: translateY(10px);
}

html.js .lift-in.is-up {
  opacity: 1;
  transform: none;
}

.no-js .lift-in {
  opacity: 1 !important;
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lift-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Breakpoints */
@media (max-width: 1100px) {
  .cardgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .rail {
    position: static;
    height: auto;
    width: 100%;
    grid-column: 1;
    grid-row: auto;
    border-right: 0;
    border-bottom: 1px solid #7F856F55;
    padding: 1rem 1.1rem 1.05rem;
    gap: 0.85rem;
  }

  .page,
  .sitefoot {
    grid-column: 1;
  }

  .rail__nav {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.35rem 1.1rem;
    margin: 0;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .rail__link {
    white-space: nowrap;
    padding: 0.25rem 0.15rem;
    border-left: 0;
    border-bottom: 3px solid transparent;
  }

  .rail__link.is-here {
    border-bottom-color: #5C7A38;
  }

  .rail__meta { display: none; }

  section { scroll-margin-top: 5.5rem; }
}

@media (max-width: 900px) {
  .spread {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .spread__side {
    border: 1px solid #7F856F;
    padding: 0.9rem 1rem;
    background: #E4E7DA;
  }

  .loopdiagram__pass:not(:last-child)::after { display: none; }

  .h-large { font-size: 1.85rem; }
}

@media (max-width: 860px) {
  .colset {
    columns: 1;
    column-rule: none;
  }
}

@media (max-width: 720px) {
  .cardgrid { grid-template-columns: 1fr; }

  .loopdiagram {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .ladder__rung:nth-child(n) {
    margin-left: 0;
  }

  .timeline__slot {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .cover { min-height: 40vh; }
  .is-home .cover { min-height: 50vh; }
}

@media (max-width: 520px) {
  .enquiry { padding: 1.1rem; }
}
