/* ============================================================================
   CAPABILITIES & PROJECTS — templates/website/projects.html only
   ----------------------------------------------------------------------------
   Loaded after website.css, which owns every token, the accordion, the spec
   rows, the cards and the reveal engine. Nothing here re-declares a colour:
   each rule reaches for the same variables so both themes stay correct with
   no second set of rules to keep in step.

   Four things live in this file and nowhere else:
     · the compact page head and its stat strip
     · the capability accordion's row furniture (number, glyph, checked list)
     · the RMC plant drawing — this page's signature, drawn in line-work
     · the portfolio rail and the alternating project rows
   ========================================================================== */

/* ---------------------------------------------------------------------------
   PAGE HEAD
   Deliberately about 60svh rather than the home page's full screen. This page
   is a capability statement: it should be delivering facts inside one screen,
   not holding a poster.
   ------------------------------------------------------------------------- */
.bs-phead {
  position: relative;
  min-height: 60svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--bs-header-h) + clamp(36px, 6vw, 84px));
  padding-bottom: clamp(48px, 7vw, 96px);
}
.bs-phead > .bs-shell { width: 100%; }

/* The stat strip. Hairlines between the columns only — a border on every cell
   doubles up at the grid's edges and starts reading as a table. */
.bs-phead__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 900px) {
  .bs-phead__stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.bs-phead__cell {
  padding: clamp(26px, 3.4vw, 44px) clamp(16px, 2.4vw, 32px) clamp(26px, 3.4vw, 44px) 0;
  border-bottom: 1px solid var(--bs-hairline);
}
.bs-phead__cell + .bs-phead__cell {
  border-left: 1px solid var(--bs-hairline);
  padding-left: clamp(16px, 2.4vw, 32px);
}
@media (max-width: 899px) {
  .bs-phead__cell:nth-child(odd) { border-left: 0; padding-left: 0; }
}

/* ---------------------------------------------------------------------------
   CAPABILITY ACCORDION
   The mechanics (ARIA, open/close, single-open) are website.js's. Everything
   below is the row furniture: an oversized index, a line glyph, and the
   two-column panel.
   ------------------------------------------------------------------------- */
/* The panel indent tracks the width of the number, the glyph and the two gaps
   in front of the title, so the open body starts on the title's left edge
   rather than the row's. It is a measured approximation of a fluid stack, not
   a coincidence — if the number or the glyph changes size, change these. */
.bs-caps2 { --cap-indent: 0px; }
@media (min-width: 640px)  { .bs-caps2 { --cap-indent: 118px; } }
@media (min-width: 1024px) { .bs-caps2 { --cap-indent: 150px; } }

.bs-cap__heading { margin: 0; }

.bs-cap__btn {
  align-items: center;
  gap: clamp(14px, 2.2vw, 26px);
}

.bs-cap__num {
  flex: none;
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 46px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--bs-ink) / 0.2);
  transition: color 380ms var(--bs-ease-smooth);
}
.bs-acc__item.is-open .bs-cap__num,
.bs-acc__btn:hover .bs-cap__num { color: rgb(var(--bs-brand-ink)); }

/* The glyph is a small elevation of the discipline, in the same line language
   as the plant drawing below. It is decoration, so it goes first on the
   cutting-room floor when the row runs out of width. */
.bs-cap__glyph {
  display: none;
  flex: none;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--bs-hairline);
  border-radius: 3px;
  color: rgb(var(--bs-ink-3));
  transition: color 380ms var(--bs-ease-smooth), border-color 380ms var(--bs-ease-smooth);
}
@media (min-width: 640px) { .bs-cap__glyph { display: grid; } }
.bs-cap__glyph svg { width: 26px; height: 26px; }
.bs-acc__item.is-open .bs-cap__glyph {
  color: rgb(var(--bs-brand-ink));
  border-color: rgb(var(--bs-brand-ink) / 0.4);
}

.bs-cap__label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bs-cap__title { display: block; color: inherit; }
.bs-cap__sub { color: rgb(var(--bs-ink-3)); }

/* The panel is indented to sit under the title rather than under the number,
   so the eye keeps one left edge all the way down the section. */
.bs-cap__body {
  display: grid;
  gap: clamp(20px, 3vw, 44px);
  padding-left: var(--cap-indent);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .bs-cap__body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.bs-checks { display: grid; gap: 2px; align-content: start; }
.bs-checks li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding-block: 9px;
  border-bottom: 1px solid var(--bs-hairline);
}
.bs-checks li:first-child { border-top: 1px solid var(--bs-hairline); }
.bs-checks svg { margin-top: 5px; color: rgb(var(--bs-brand-ink)); }

/* ---------------------------------------------------------------------------
   TECHNICAL CAPABILITY LIST
   ------------------------------------------------------------------------- */
.bs-tech { border-top: 1px solid var(--bs-hairline); }
.bs-tech__row {
  display: grid;
  grid-template-columns: 3.4em minmax(0, 1fr);
  gap: 8px 16px;
  align-items: baseline;
  padding-block: clamp(16px, 1.8vw, 22px);
  border-bottom: 1px solid var(--bs-hairline);
}
.bs-tech__text { color: rgb(var(--bs-ink)); font-weight: 500; }

/* ---------------------------------------------------------------------------
   THE PLANT DRAWING
   The page signature, and the same idea as the arch elevation on the home
   page: a photograph of a batching plant would be a stock image of somebody
   else's plant, would need a second file for dark mode, and would weigh more
   than this whole page. Line-work in currentColor has none of those problems.
   ------------------------------------------------------------------------- */
.bs-plant {
  max-width: 1120px;
  margin-inline: auto;
  border: 1px solid var(--bs-hairline);
  border-radius: 3px;
  background: rgb(var(--bs-surface));
  box-shadow: var(--bs-shadow-card);
  overflow: hidden;
}

.bs-plant__head,
.bs-plant__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgb(var(--bs-ink-3));
}
.bs-plant__head { border-bottom: 1px solid var(--bs-hairline); }
.bs-plant__foot { border-top: 1px solid var(--bs-hairline); background: rgb(var(--bs-surface-2)); }
.bs-plant__ref { color: rgb(var(--bs-brand-ink)); }

/* Below the tablet breakpoint the drawing is panned rather than shrunk. A
   layout drawing squeezed to 340px is a grey smudge with unreadable labels;
   panning keeps it a drawing. The container is focusable so the pan is
   reachable from the keyboard as well as the thumb. */
.bs-plant__scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.bs-plant__svg {
  width: 100%;
  min-width: 720px;
  height: auto;
  display: block;
  padding: 12px 8px 0;
  color: rgb(var(--bs-ink-2));
}
/* The foot bar's right-hand slot: the pan hint while the drawing is being
   panned, the sheet's own note once it fits. */
.bs-plant__hint { color: rgb(var(--bs-ink-3)); }
.bs-plant__fleet { display: none; }
@media (min-width: 768px) {
  .bs-plant__svg { min-width: 0; }
  .bs-plant__hint { display: none; }
  .bs-plant__fleet { display: block; }
}

/* Each stroke unrolls its own dash. projects.js sets pathLength="1" on every
   line first, so one dasharray value covers a 400-unit conveyor and a 12-unit
   wheel hub alike — the alternative is measuring each path in JavaScript and
   writing the number back, which draws the same picture for more code. */
html.has-js .bs-plant__ink .ln {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1100ms var(--bs-ease-smooth);
  transition-delay: calc(var(--o, 0) * 1ms);
}
html.has-js .bs-plant.is-drawn .ln { stroke-dashoffset: 0; }

.bs-plant__ink .ln--faint { opacity: 0.42; }

/* Two strokes are genuinely dashed — the mixer shaft and the belt itself — so
   they opt out of the draw-in and simply fade up. */
.bs-plant__ink .ln--dash { stroke-dasharray: 8 10; stroke-dashoffset: 0; opacity: 0.5; }
html.has-js .bs-plant__ink .ln--dash {
  opacity: 0;
  transition: opacity 700ms var(--bs-ease-smooth) 520ms;
}
html.has-js .bs-plant.is-drawn .ln--dash { opacity: 0.5; }

/* The material path: aggregate to belt, belt to hopper, hopper to mixer,
   mixer to drum. It is the one thing on the drawing worth the accent colour,
   and the only moving part — a slow dash march that reads as "the plant is
   running", the same argument as the pulsing dot on every eyebrow. */
.bs-plant__ink .ln--flow,
.bs-plant__ink .ln--flowhead {
  stroke: rgb(var(--bs-brand-ink));
  stroke-width: 1.6;
  opacity: 0.92;
}
html.has-js .bs-plant__ink .ln--flow,
html.has-js .bs-plant__ink .ln--flowhead {
  opacity: 0;
  transition: opacity 800ms var(--bs-ease-smooth) 1000ms;
}
.bs-plant__ink .ln--flow { stroke-dasharray: 7 9; stroke-dashoffset: 0; }
/* The dash march starts only once the drawing has been reached. It is an
   infinite stroke-dashoffset animation — it cannot be composited, so it
   repaints on the main thread every frame — and it was previously running
   from first paint on an element 4,477px below the fold at opacity 0. */
.bs-plant.is-drawn .ln--flow { animation: bs-flow 1400ms linear infinite; }
.bs-plant__ink .ln--flowhead { stroke-dasharray: none; stroke-dashoffset: 0; }
.bs-plant.is-drawn .ln--flow,
.bs-plant.is-drawn .ln--flowhead { opacity: 0.92; }
@keyframes bs-flow {
  from { stroke-dashoffset: 32; }
  to   { stroke-dashoffset: 0; }
}

.bs-plant__label text {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  fill: rgb(var(--bs-ink-3));
}
html.has-js .bs-plant__label text {
  opacity: 0;
  transition: opacity 700ms var(--bs-ease-smooth) 900ms;
}
.bs-plant.is-drawn .bs-plant__label text { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .bs-plant__ink .ln { stroke-dashoffset: 0 !important; transition: none !important; }
  .bs-plant__ink .ln--dash { opacity: 0.5 !important; }
  .bs-plant__ink .ln--flow { animation: none !important; }
  .bs-plant__ink .ln--flow,
  .bs-plant__ink .ln--flowhead { opacity: 0.92 !important; }
  .bs-plant__label text { opacity: 1 !important; }
}

/* ---------------------------------------------------------------------------
   PORTFOLIO
   ------------------------------------------------------------------------- */
.bs-port { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1024px) {
  .bs-port {
    grid-template-columns: minmax(190px, 1fr) minmax(0, 3.5fr);
    gap: clamp(32px, 4vw, 76px);
  }
}

/* -- the rail -------------------------------------------------------------
   A duplicate of navigation the visitor already has by scrolling, so it is
   desktop-only: on a phone it would cost a screen of height to say what the
   next heading says anyway. --------------------------------------------- */
.bs-rail { display: none; }
@media (min-width: 1024px) {
  /* NOT align-self: start. That shrink-wraps this grid item to its own
     content (351px) inside a 2100px row, leaving .bs-rail__inner with no
     travel at all — position:sticky is only ever as tall as the box it
     sticks inside. Default `stretch` gives it the full row. */
  .bs-rail { display: block; }
  .bs-rail__inner { position: sticky; top: calc(var(--bs-header-h) + 56px); }
}

.bs-rail__list { position: relative; margin-top: 26px; padding-left: 24px; }

.bs-rail__track {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--bs-hairline-strong);
}
/* Scroll-linked: projects.js writes scaleY() and nothing else, so the fill
   stays on the compositor no matter how fast the page is flicked. */
.bs-rail__fill {
  position: absolute;
  inset: 0;
  background: rgb(var(--bs-brand));
  transform: scaleY(0);
  transform-origin: top center;
}

.bs-rail__link {
  position: relative;
  display: block;
  padding-block: 16px;
  transition: color 300ms var(--bs-ease-smooth);
}
.bs-rail__link::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(var(--bs-bg));
  border: 1px solid var(--bs-hairline-strong);
  transition: background-color 320ms var(--bs-ease-smooth),
              border-color 320ms var(--bs-ease-smooth),
              transform 420ms var(--bs-ease-spring);
}
.bs-rail__link.is-active::before {
  background: rgb(var(--bs-brand));
  border-color: rgb(var(--bs-brand-ink));
  transform: scale(1.35);
}

.bs-rail__num {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: rgb(var(--bs-ink-3));
}
.bs-rail__name {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  color: rgb(var(--bs-ink-2));
  transition: color 300ms var(--bs-ease-smooth);
}
.bs-rail__meta {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: rgb(var(--bs-ink-3));
}
.bs-rail__link:hover .bs-rail__name { color: rgb(var(--bs-brand-ink)); }
.bs-rail__link.is-active .bs-rail__name { color: rgb(var(--bs-ink)); }

/* -- the rows -------------------------------------------------------------- */
.bs-port__rows { display: flex; flex-direction: column; }

.bs-proj { padding-block: clamp(44px, 6vw, 88px); }
.bs-proj:first-child { padding-top: clamp(28px, 4vw, 56px); }
.bs-proj + .bs-proj { border-top: 1px solid var(--bs-hairline); }

.bs-proj__head { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; }
.bs-proj__num {
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: rgb(var(--bs-ink) / 0.2);
}
.bs-proj__loc { color: rgb(var(--bs-ink-3)); margin-left: auto; }

.bs-proj__grid { display: grid; grid-template-columns: 1fr; gap: clamp(28px, 4vw, 56px); }
@media (min-width: 900px) {
  .bs-proj__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: start; }
  /* Alternating sides. Placing both children explicitly beats reversing the
     container: the DOM order stays the reading order, so a screen reader and
     a keyboard still meet the name before the numbers. */
  .bs-proj:nth-child(even) .bs-proj__body { grid-column: 2; grid-row: 1; }
  .bs-proj:nth-child(even) .bs-proj__data { grid-column: 1; grid-row: 1; }
}

.bs-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.bs-proj__value { border-top: 2px solid rgb(var(--bs-brand)); padding-top: 20px; }
.bs-proj__valuelabel { color: rgb(var(--bs-ink-3)); }
.bs-proj__crore { margin-top: 14px; }
.bs-proj__exact {
  margin-top: 10px;
  color: rgb(var(--bs-ink-3));
  letter-spacing: 0.08em;
}

/* ---------------------------------------------------------------------------
   QUALITY ASSURANCE
   The section heading is the grid's first cell rather than a band across the
   top: five cards plus one intro fills a three-column grid exactly, and a
   two-column one exactly as well, so no row is ever left with a gap in it.
   ------------------------------------------------------------------------- */
.bs-qa { background: rgb(var(--bs-bg-alt)); }
.bs-qa__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 2.4vw, 30px);
}
@media (min-width: 720px)  { .bs-qa__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1120px) { .bs-qa__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.bs-qa__intro { display: flex; flex-direction: column; justify-content: center; }
@media (min-width: 720px) { .bs-qa__intro { padding-right: clamp(0px, 2vw, 24px); } }

.bs-qa__card { display: flex; flex-direction: column; }
.bs-qa__num {
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: rgb(var(--bs-brand-ink));
}

/* ---------------------------------------------------------------------------
   PRINT
   A tender committee prints this page, and a closed accordion prints as six
   headings and no content — which would leave the capability statement off
   the capability statement.
   ------------------------------------------------------------------------- */
@media print {
  .bs-acc__panel { grid-template-rows: 1fr !important; }
  .bs-acc__panelinner { overflow: visible !important; }
  .bs-acc__sign, .bs-rail, .bs-plant__hint { display: none !important; }
  .bs-plant__scroll { overflow: visible !important; }
  .bs-plant__svg { min-width: 0 !important; }
  .bs-plant__ink .ln { stroke-dashoffset: 0 !important; }
  .bs-plant__ink .ln--dash, .bs-plant__ink .ln--flow,
  .bs-plant__ink .ln--flowhead, .bs-plant__label text { opacity: 1 !important; }
  .bs-port { display: block; }
  .bs-proj, .bs-qa__card, .bs-plant { break-inside: avoid; }
  .bs-phead { min-height: 0; padding-top: 0; }
}

/* ---------------------------------------------------------------------------
   KEYBOARD PARITY
   Every hover treatment on this page needs its focus-visible twin, or a
   keyboard user tabbing the rail and the capability rows gets no feedback at
   all. about.css and contact.css already pair theirs.
   ------------------------------------------------------------------------- */
.bs-rail__link:focus-visible .bs-rail__name { color: rgb(var(--bs-brand-ink)); }
.bs-acc__btn:focus-visible .bs-cap__num { color: rgb(var(--bs-brand-ink)); }

/* The pannable drawing is deliberately focusable, but it is also a clipping
   scroll box — an outline drawn outside it is clipped away and never seen.
   A negative offset paints the ring inside the clip. */
.bs-plant__scroll:focus-visible {
  outline: 2px solid rgb(var(--bs-brand-ink));
  outline-offset: -3px;
}

/* ---------------------------------------------------------------------------
   PROJECT PHOTO GALLERY (v46)
   One large photograph and up to three smaller ones, all the company's own.
   The modifier is the number of photographs, so two and four both lay out.
   ------------------------------------------------------------------------- */
.bs-stat__exact { margin-top: 8px; }
.bs-gallery { display: grid; gap: 12px; grid-template-columns: 1fr; }
.bs-gallery__item { min-width: 0; }
@media (min-width: 720px) {
  .bs-gallery--2 { grid-template-columns: 1.4fr 1fr; height: clamp(280px, 32vw, 440px); }
  .bs-gallery--4 {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: clamp(360px, 40vw, 560px);
  }
  .bs-gallery--4 .bs-gallery__item:first-child { grid-row: 1 / 3; }
  .bs-gallery--4 .bs-gallery__item:nth-child(2) { grid-row: 1 / 3; }
}
@media (max-width: 719px) {
  .bs-gallery .bs-photo--fill { aspect-ratio: 3 / 2; height: auto; }
}

/* ---------------------------------------------------------------------------
   ON SITE — plant, fleet and crew
   ------------------------------------------------------------------------- */
.bs-onsite { background: rgb(var(--bs-bg-alt)); }
.bs-sitegrid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.bs-sitegrid__a { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .bs-sitegrid {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: clamp(420px, 44vw, 620px);
  }
  .bs-sitegrid__a { grid-column: 1; grid-row: 1 / 3; }
  .bs-sitegrid__b { grid-column: 2; grid-row: 1 / 3; }
  .bs-sitegrid__c { grid-column: 3; grid-row: 1; }
  .bs-sitegrid__d { grid-column: 3; grid-row: 2; }
}
@media (max-width: 899px) {
  .bs-sitegrid .bs-photo--fill { aspect-ratio: 1 / 1; height: auto; }
  .bs-sitegrid__a .bs-photo--fill { aspect-ratio: 3 / 2; }
}
.bs-proj { scroll-margin-top: calc(var(--bs-header-h) + 8px); }
