/* Marble Construction website
   Ink line on white, red only where the building is red.
   Jost for words, DM Mono for measurements. */

@font-face {
  font-family: "Jost";
  src: url("/fonts/Jost-VF.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/DMMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/DMMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --wash: #f4f5f5;
  --ink: #11110e;
  --mid: #5f6364;
  --soft-line: #d5d8d8;
  --red: #c11e22;
  --line: 1px solid var(--ink);
  --gutter: clamp(16px, 3.5vw, 56px);
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Jost", "Futura", "Century Gothic", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }
.measure { font-family: var(--mono); font-size: 0.875rem; letter-spacing: -0.01em; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 30; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* "Draft copy" tag: shown beside any text Marble has not yet approved.
   It appears wherever a content file has "draft": true. */
.draft-tag {
  display: inline-block; vertical-align: middle;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500; line-height: 1;
  color: var(--red); background: var(--paper); border: 1px solid var(--red);
  padding: 4px 7px; margin: 0 0 0 8px; letter-spacing: 0; white-space: nowrap;
}
p.draft-note { color: var(--red); font-size: 0.9375rem; margin-top: 10px; max-width: 60ch; }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; gap: 32px;
  padding: 18px var(--gutter);
  border-bottom: var(--line);
  position: relative;
}
.logo img { width: 150px; }
.site-nav { margin-left: auto; order: 2; }
.header-phone { order: 3; }
.site-nav ul { display: flex; gap: clamp(16px, 2.2vw, 34px); }
.site-nav a { text-decoration: none; font-weight: 500; }
.site-nav a[aria-current] { color: var(--red); }
.header-phone { font-weight: 500; text-decoration: none; padding-left: clamp(16px, 2.2vw, 34px); border-left: var(--line); white-space: nowrap; }
.menu-toggle { display: none; }

/* ---------- Buttons ---------- */
.button {
  display: inline-block; padding: 12px 20px;
  border: var(--line); background: var(--ink); color: #fff;
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--red); border-color: var(--red); color: #fff; }
.button.quiet { background: transparent; color: var(--ink); }
.button.quiet:hover { background: transparent; color: var(--red); border-color: var(--red); }
.square-button {
  width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer;
  background: var(--paper); color: var(--ink); border: var(--line);
}
.square-button:hover { background: var(--ink); color: #fff; }
.square-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* ---------- Home: hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: 24px;
  padding: clamp(24px, 4vw, 56px) 0 clamp(24px, 4vw, 56px) var(--gutter);
  overflow: hidden;
  overflow: clip;   /* the drawing runs off the edge; clip, so that clicking on it can never scroll the hero sideways */
}
.hero h1 {
  font-size: clamp(2.125rem, 4.1vw, 3.75rem);
  font-weight: 500; line-height: 1.04; letter-spacing: -0.025em; max-width: 15ch;
}
.hero-text > p { margin-top: 22px; max-width: 44ch; color: var(--mid); }
/* The short line under the headline ("strapline" in home.json). */
.hero-text > p.hero-strap { color: var(--ink); font-weight: 500; font-size: 1.1875rem; line-height: 1.35; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-drawing { margin: 0 -4% 0 -5%; position: relative; }

.hero-stage picture { display: block; }
.hero-stage img { width: 100%; height: auto; animation: plot 1.5s cubic-bezier(0.6, 0, 0.2, 1) both; }
.hero-drawing figcaption { color: var(--red); }
@keyframes plot { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes sway { 0%, 100% { transform: none; } 30% { transform: translateX(-5px); } 70% { transform: translateX(5px); } }

/* The live 3D drawing (src/js/hero-3d.js) sits exactly over the still one, so nothing moves when it takes over. */
.hero-stage { position: relative; }
.hero-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  opacity: 0; transition: opacity 0.4s; cursor: grab;
  touch-action: pan-y;   /* an up or down swipe still scrolls the page */
}
.hero-stage canvas.is-dragging { cursor: grabbing; }
.hero-stage canvas:focus-visible { outline-offset: -2px; }
.hero-drawing.is-live canvas { opacity: 1; }
.hero-drawing.is-settled .hero-stage img { visibility: hidden; }
.hero-dim { position: absolute; left: 0; top: 0; z-index: 1; padding: 0 5px; background: rgba(255, 255, 255, 0.9); color: var(--red); font-size: 0.75rem; line-height: 1.5; white-space: nowrap; pointer-events: none; }
/* The Isometric / Perspective switch: plain words, the current one underlined in red. It is in the page from the
   start but invisible, and keeps its space, so nothing moves when the live drawing arrives and it fades in. */
.hero-view { display: flex; align-items: baseline; gap: 8px; color: var(--mid); visibility: hidden; opacity: 0; transition: opacity 0.5s; }
.hero-drawing.is-live .hero-view { visibility: visible; opacity: 1; }
html:not(.js) .hero-view { display: none; }
.hero-view button { font: inherit; color: var(--mid); background: none; border: 0; padding: 6px 0; cursor: pointer; }
.hero-view button:hover { color: var(--ink); }
.hero-view button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; text-underline-offset: 5px; }
/* The small "this turns" mark: it appears once the live drawing is running and goes once it has been turned. */
.hero-drag { line-height: 0; pointer-events: none; opacity: 0; transition: opacity 0.6s; }
.hero-drag svg { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.hero-drag circle { fill: var(--paper); }
.hero-drawing.is-live .hero-drag { opacity: 1; }
.hero-drawing.is-live .hero-drag svg { animation: sway 1.1s ease-in-out 1.2s 3; }
.hero-drawing.is-live.is-touched .hero-drag { opacity: 0; }
/* Wide screens: one caption line under the drawing (the address, then the mark), and the switch on its own in the
   top right corner of the drawing area, which the model does not reach. Both end on the page margin, in line with
   the phone number above; the drawing itself runs 4% past it, which is what the 3.67% allows for. */
@media (min-width: 861px) {
  .hero-caption { margin: 4px calc(3.67% + var(--gutter)) 0 5%; }
  .hero-drawing figcaption { margin: 0; display: flex; align-items: center; gap: 14px; min-height: 24px; white-space: nowrap; }
  .hero-drawing figcaption, .hero-view { font-size: clamp(0.75rem, 1.05vw, 0.875rem); }
  .hero-view { position: absolute; top: 4px; right: calc(3.67% + var(--gutter)); z-index: 2; }
  .hero-drag.on-drawing { display: none; }
  .hero-drag.in-caption { flex: none; }
}

/* ---------- Home: the hero slideshow ----------
   Switched on by "slideshow" in content/pages/home.json. The office drawing is sheet 1; the cover photographs of
   the first few featured projects follow it in the same box. home.mjs adds "has-slides" to the figure, the
   controls (.hs-bar) and a wrapper round the drawing (.hs-slot); src/js/site.js puts the photographs in.
   Nothing here applies when the slideshow is off. "hs" is short for hero slideshow. */

/* The figure becomes a small grid: the picture on top, then the caption and the controls beside each other.
   .hero-caption gives up its own box so that its children sit straight in that grid. */
.hero-drawing.has-slides { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
.has-slides .hs-slot { grid-column: 1 / -1; grid-row: 1; position: relative; min-width: 0; }
.has-slides .hero-caption { display: contents; }
.hero-drawing.has-slides figcaption { grid-column: 1; grid-row: 2; min-width: 0; }
html:not(.js) .hs-bar { display: none; }

/* Controls: pause or play, back, "Sheet 2 of 6", forward. Square cells ruled like a title block. */
.hs-bar { display: flex; align-items: stretch; height: 44px; position: relative; z-index: 1; }
.hs-btn {
  flex: none; width: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink); border: var(--line); padding: 0; cursor: pointer;
}
.hs-btn + .hs-btn, .hs-count + .hs-btn { margin-left: -1px; }
.hs-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.hs-btn .i-pause { stroke-width: 2.75; }                      /* two solid bars */
.hs-btn .i-play { fill: currentColor; stroke-width: 1; }      /* a solid triangle */
.hs-btn:hover { background: var(--ink); color: #fff; }
.hs-btn:focus-visible { outline-offset: -5px; position: relative; z-index: 1; }
.hs-toggle .i-play, .is-paused .hs-toggle .i-pause { display: none; }
.is-paused .hs-toggle .i-play { display: block; }
.hs-count {
  position: relative; display: flex; align-items: center; justify-content: center; min-width: 8.6em; padding: 0 12px;
  border: var(--line); border-right: 0; margin-left: -1px;
  font-size: 0.8125rem; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums;
}
/* A red hairline that fills as the time on this sheet runs out. It is also the clock: site.js moves on when it
   is full ("hs-run" ends) and fetches the next photograph a little before ("hs-soon" ends). It stands still
   whenever the figure is not "is-running": paused, pointed at, tabbed into, off screen or in a hidden tab. */
.hs-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: 0 50%;
  animation: hs-run var(--hs-time, 10s) linear forwards, hs-soon var(--hs-soon, 7.5s) linear forwards; animation-play-state: paused;
}
.is-running .hs-progress { animation-play-state: running; }
.is-paused .hs-progress { opacity: 0; }
@keyframes hs-run { to { transform: none; } }
@keyframes hs-soon { to { outline-offset: 0; } }   /* changes nothing; only its ending matters */

/* The photographs lie on a sheet of white paper over the drawing. */
.hs-photos {
  position: absolute; inset: 0; z-index: 3; background: var(--paper);
  opacity: 0; visibility: hidden; transition: opacity 0.5s, visibility 0s 0.5s;
  touch-action: pan-y;   /* an up or down swipe still scrolls the page */
}
.is-photo .hs-photos { opacity: 1; visibility: visible; transition: opacity 0.5s; }
.hs-frame { position: absolute; inset: 0; overflow: hidden; background: var(--wash); }
.hs-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.5s, visibility 0s 0.5s; }
.hs-slide.is-current { opacity: 1; visibility: visible; z-index: 2; transition: opacity 0.5s; }
.hs-slide.is-leaving { opacity: 1; visibility: visible; z-index: 1; transition: none; }
.hs-slide a { display: block; width: 100%; height: 100%; }
.hs-slide a:focus-visible { outline-width: 3px; outline-offset: -5px; }
.hs-slide img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s; -webkit-user-drag: none; }
.hs-slide img.is-loaded { opacity: 1; }

/* On a photograph the caption is the project's name (a link), and the drawing's own extras stand down. */
.has-slides figcaption a { color: inherit; text-decoration: none; }
.has-slides figcaption a:hover .cap-name { text-decoration: underline; text-underline-offset: 3px; }
.hero-drawing.is-photo .hero-drag { display: none; }
/* once the photograph has faded in the drawing beneath is put away, so not a hair of it can show at the paper's edge */
.hero-drawing.is-photo .hero-stage { visibility: hidden; transition: visibility 0s 0.5s; }
.hero-drawing.is-photo .hero-view { visibility: hidden; opacity: 0; transition: none; }

/* Wide screens: the drawing stays unframed. The caption is on the left of the line under it and the controls at
   the right-hand end of that line, on the page margin. A photograph is a ruled print between the caption's left
   edge and the page margin. */
@media (min-width: 861px) {
  .hero-drawing.has-slides figcaption { margin: 8px 0 0 5%; min-height: 44px; padding-right: calc(3.67% + var(--gutter) + 262px); white-space: normal; line-height: 1.4; }
  /* the bar spans the row and sits at its right-hand end, so that its margin is measured from the whole figure */
  .has-slides .hs-bar { grid-column: 1 / -1; grid-row: 2; justify-self: end; margin: 8px calc(3.67% + var(--gutter)) 0 0; }
  .has-slides .cap-name { font-weight: 500; }
  .hs-photos { inset: -1px; }   /* a hair over, so no edge of the drawing can show round the paper */
  .hs-frame { inset: 1px; left: 5%; right: calc(3.67% + var(--gutter)); border: var(--line); }
}
/* Phones: the sheet's title block gains a second row for the controls, drawn on the same grid as the first:
   the back and forward cells together are exactly as wide as the Isometric / Perspective cell above them, so
   the rule on their left is one line. On a photograph the caption has the whole of the first row. */
@media (max-width: 860px) {
  /* the rule between the picture and the title block belongs to the picture, so it is whole even while the right-hand cell is empty */
  .has-slides .hs-slot { border-bottom: var(--line); }
  .hero-drawing.has-slides figcaption { min-height: 53px; display: flex; flex-direction: column; justify-content: center; }
  .has-slides .hero-view { grid-column: 2 / -1; grid-row: 2; border-left: var(--line); width: 105px; }
  .has-slides.is-photo figcaption { grid-column: 1 / -1; }
  .has-slides .hs-bar { grid-column: 1 / -1; grid-row: 3; border-top: var(--line); height: 45px; }
  .has-slides .hs-btn { border-width: 0; margin: 0; width: 52px; }          /* forward */
  .has-slides [data-hs-prev] { border-width: 0 0 0 1px; width: 53px; }      /* back: 53 + 52 = the 105 px cell above */
  .has-slides .hs-toggle { order: -2; width: 44px; }
  .has-slides .hs-count { order: -1; flex: 1; justify-content: flex-start; border: 0; margin: 0; padding: 0 10px 0 2px; font-size: 0.75rem; }
  .has-slides .hs-progress { bottom: 0; left: -44px; }                       /* the line starts under the pause button */
  .has-slides .hs-btn:hover { background: var(--paper); color: var(--ink); }
  .has-slides .hs-btn:active { background: var(--ink); color: #fff; }
}
/* The very narrowest phones: captions may run to two lines, so the cell is always tall enough for that. */
@media (max-width: 345px) {
  .hero-drawing.has-slides figcaption { min-height: 67px; }
}

/* Title block: the strip of boxed details found in the corner of a drawing. */
.title-block {
  display: grid; grid-template-columns: 1.4fr 2fr 1fr 1.6fr;
  border-top: var(--line); border-bottom: var(--line);
  margin: 0; padding: 0 var(--gutter);
}
.title-block div { padding: 14px 20px 16px; border-left: var(--line); min-width: 0; }
.title-block div:last-child { border-right: var(--line); }
.title-block dt { color: var(--mid); font-size: 0.875rem; }
.title-block dd { font-weight: 500; overflow-wrap: anywhere; }
.title-block a { text-decoration: none; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 112px) var(--gutter) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: 28px; }
.section h2, .page-head h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
figcaption { color: var(--mid); font-size: 0.9375rem; margin-top: 8px; }

.page-head { padding: clamp(28px, 4.5vw, 64px) var(--gutter) 0; }
.page-head h1 { font-size: clamp(2.25rem, 4.6vw, 4rem); letter-spacing: -0.028em; line-height: 1; }
.page-head .lead { font-size: clamp(1.1875rem, 1.7vw, 1.4375rem); line-height: 1.4; max-width: 46ch; margin-top: 18px; }
.page-head.with-rule { padding-bottom: clamp(24px, 3vw, 40px); border-bottom: var(--line); }

/* ---------- Project cards: sideways strip (home) and grid (projects page) ---------- */
.lenses { display: flex; flex-wrap: wrap; gap: 8px; }
.lenses a {
  font-weight: 500; padding: 7px 14px; text-decoration: none;
  background: transparent; color: var(--ink); border: var(--line);
}
.lenses a:hover { border-color: var(--red); }
.lenses a[aria-current="true"] { background: var(--ink); color: #fff; }
.lenses .measure { margin-left: 6px; opacity: 0.75; }

.card a { display: block; text-decoration: none; }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--wash); border: var(--line); }
.card h3 { font-size: 1.25rem; font-weight: 500; margin-top: 12px; line-height: 1.25; }
.card p { color: var(--mid); }
.card .measure { display: flex; gap: 18px; margin-top: 6px; color: var(--ink); }

.strip {
  display: flex; gap: 20px;
  margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 18px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: var(--gutter);
  scrollbar-width: thin; scrollbar-color: var(--ink) transparent;
}
.strip .card { flex: 0 0 min(440px, 82vw); scroll-snap-align: start; }
.strip-nav { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.strip-nav a { margin-right: auto; font-weight: 500; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
.project-grid .card[hidden] { display: none; }
.lens-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 20px var(--gutter); border-bottom: var(--line); }
.lens-bar .measure { color: var(--mid); }
.grid-wrap { padding: clamp(24px, 3vw, 40px) var(--gutter) 0; }

/* ---------- Two-column text and picture blocks ---------- */
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4.5vw, 72px); align-items: start; }
.split.text-first { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.split figure img { width: 100%; border: var(--line); }
/* About: the office from the air. A still photograph with a turnable view drawn over it on a canvas (src/js/orbit.js). The canvas is invisible
   until the first photographs of the set have arrived, so the still is what shows first, without JavaScript, and whenever the turning view is not wanted. */
.orbit-frame { position: relative; aspect-ratio: 16 / 9; border: var(--line); background: var(--wash); overflow: hidden;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.split .orbit-frame img { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; }
.orbit-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.4s; }
.orbit-frame.is-live canvas { opacity: 1; }
.orbit-frame.is-live { cursor: grab; }
.orbit-frame.is-held { cursor: grabbing; }
.orbit-frame:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.orbit-toggle { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; padding: 0; opacity: 0.9; }
.orbit-toggle[hidden] { display: none; }   /* shown by the script, so it is absent without JavaScript */
.orbit-toggle:hover, .orbit-toggle:focus-visible { opacity: 1; }
.orbit-toggle:focus-visible { outline-offset: 2px; }
.orbit-toggle svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.orbit-toggle .icon-pause, .orbit-frame.is-playing .icon-play { display: none; }
.orbit-frame.is-playing .icon-pause { display: block; }
/* "Drag to turn": shown when the turning view starts, gone once the visitor has turned it. */
.orbit-cue { position: absolute; left: 10px; bottom: 10px; height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 9px;
  background: var(--paper); border: var(--line); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1;
  pointer-events: none; opacity: 0; transition: opacity 0.6s; }
.orbit-cue svg { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.orbit-cue circle { fill: var(--paper); }
.orbit-frame.is-live .orbit-cue { opacity: 0.94; }
.orbit-frame.is-live .orbit-cue svg { animation: sway 1.1s ease-in-out 1.2s 3; }
.orbit-frame.is-live.is-touched .orbit-cue { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .orbit-frame canvas, .orbit-cue { transition: none; } .orbit-frame.is-live .orbit-cue svg { animation: none; } }
.prose p { margin-top: 1em; max-width: 58ch; }
.prose > :first-child { margin-top: 0; }
.text-page h2 { margin-top: 1.6em; font-size: 1.5rem; }
.text-page h2:first-child { margin-top: 0; }
.text-page h2 + p { margin-top: 0.6em; }
.prose .signature { font-weight: 500; }
/* Privacy page: the "do not count my visits" switch (src/js/stats.js fills in the line under it). */
.stats-switch { margin-top: 1.2em; padding: 16px 18px; border: var(--line); max-width: 58ch; }
.stats-switch label { display: flex; align-items: center; gap: 12px; font-weight: 500; cursor: pointer; }
.stats-switch input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ink); }
.stats-switch p.measure { margin-top: 8px; color: var(--mid); }

.team { margin-top: 28px; border-top: var(--line); }
.team li { display: grid; grid-template-columns: 11em 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft-line); }
.team b { font-weight: 500; }
.team span { color: var(--mid); }

.team-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); }
.team-cards li { border-top: var(--line); padding-top: 16px; }
.team-cards h3 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; }
.team-cards .role { color: var(--mid); margin-top: 2px; }
.team-cards p + p { margin-top: 10px; max-width: 38ch; }
/* Team photographs: one of the whole team above the cards, and a portrait at the top of each card.
   .photo-space is the empty frame that holds a photo's place until Marble supplies it. */
/* Team photographs are shown in black and white, whatever the original is. */
.team-photo img, .team-cards li > img { filter: grayscale(1); }
.split figure.cropped img { display: block; aspect-ratio: 3 / 2; object-fit: cover; object-position: 50% var(--focus, 50%); }
.team-photo img, .team-photo .photo-space { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.team-cards.with-photos li { border-top: 0; padding-top: 0; }
.team-cards li > img, .team-cards li > .photo-space { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%; margin-bottom: 18px; }
.photo-space {
  position: relative; border: 1px solid var(--soft-line);
  background:
    linear-gradient(to top right, transparent calc(50% - 0.5px), var(--soft-line) calc(50% - 0.5px), var(--soft-line) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom right, transparent calc(50% - 0.5px), var(--soft-line) calc(50% - 0.5px), var(--soft-line) calc(50% + 0.5px), transparent calc(50% + 0.5px));
}
.photo-space .draft-tag { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; white-space: nowrap; }

/* ---------- Testimonials ---------- */
.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 48px); }
.quotes.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Each testimonial starts with a short red line and ends with NAME | TOWN, as on Marble's Instagram review cards. */
.quote::before, .big-quote::before { content: ""; display: block; width: 48px; height: 3px; background: var(--red); }
.quote::before { margin-bottom: 18px; }
.big-quote::before { margin-bottom: 22px; }
.quote figcaption, .big-quote figcaption { color: var(--ink); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; }
.quote figcaption .bar, .big-quote figcaption .bar { display: inline-block; width: 2px; height: 0.95em; margin: 0 0.6em; background: var(--red); vertical-align: -0.1em; }
.quote figcaption .stars { display: block; margin-top: 8px; color: var(--red); font-size: 0.9rem; letter-spacing: 0.18em; }
.quote-label { margin-bottom: 10px; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.quote blockquote p { font-size: 1.1875rem; line-height: 1.45; }
.quote blockquote p + p { margin-top: 0.7em; }
.quote figcaption { margin-top: 14px; }
.quote-wall { columns: 3 320px; column-gap: clamp(20px, 3vw, 48px); }
.quote-wall .quote { break-inside: avoid; margin-bottom: 44px; }
.quote-wall .quote blockquote p { font-size: 1.0625rem; }
.big-quote blockquote p { font-size: clamp(1.375rem, 2.3vw, 2rem); line-height: 1.3; letter-spacing: -0.012em; max-width: 34ch; }
.big-quote figcaption { margin-top: 16px; }

.google-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; padding-bottom: 20px; }
.rating { display: flex; align-items: baseline; gap: 14px; margin-top: 10px; }
.rating .score { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.google-note { color: var(--mid); font-size: 0.9375rem; max-width: 62ch; margin-top: 10px; }
/* Directly under a section heading (homepage). */
.rating-line.under-head { margin: -12px 0 28px; padding-top: 0; border-top: 0; }
.rating-line { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--soft-line); }

/* ---------- Contact and the site plan slider ---------- */
.site-plan { position: relative; border: var(--line); }
.site-plan img { width: 100%; }
.site-plan svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.site-plan .plan-wash { fill: #fff; }
.site-plan .outline { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.site-plan .fine { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.site-plan .panel { fill: var(--ink); }
.site-plan .postbox { fill: var(--red); }
.site-plan text { font-family: "Jost", sans-serif; font-size: 25px; font-weight: 500; fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.site-plan text.road { letter-spacing: 0.3em; font-size: 21px; }
.plan-slider { display: flex; align-items: center; gap: 14px; margin-top: 12px; font-weight: 500; }
.plan-slider input { flex: 1; min-width: 0; }
.plan-slider input { accent-color: var(--red); height: 28px; }

.contact-actions { display: grid; gap: 0; border-top: var(--line); margin-top: 24px; }
.contact-actions a { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; align-items: baseline; padding: 14px 0; border-bottom: var(--line); text-decoration: none; }
.contact-actions .label { color: var(--mid); font-size: 0.9375rem; }
.contact-actions .value { font-size: clamp(1.25rem, 2.1vw, 1.75rem); font-weight: 500; letter-spacing: -0.015em; overflow-wrap: anywhere; line-height: 1.2; }
.address-block { font-size: 1.25rem; line-height: 1.45; margin-top: 28px; }
.address-block + p { margin-top: 10px; color: var(--mid); }
.contact-lines { margin-top: 18px; font-size: 1.25rem; font-weight: 500; }
.contact-lines a { display: block; width: fit-content; text-decoration: none; }

/* ---------- Project page ---------- */
.project-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); padding: clamp(24px, 3.5vw, 48px) var(--gutter) 0; align-items: end; }
.project-top img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: var(--line); }
.back { display: inline-block; color: var(--mid); margin-bottom: 14px; }
.project-top h1 { font-size: clamp(2.5rem, 5.4vw, 4.5rem); font-weight: 500; letter-spacing: -0.03em; line-height: 0.98; margin-bottom: 28px; }
.sheet { border: var(--line); }
.sheet div { display: grid; grid-template-columns: 9.5em 1fr; border-bottom: var(--line); }
.sheet div:last-child { border-bottom: 0; }
.sheet dt { padding: 11px 14px; color: var(--mid); border-right: var(--line); font-size: 0.9375rem; }
.sheet dd { padding: 11px 14px; font-weight: 500; }
.sheet dd.measure { font-size: 0.9375rem; padding-top: 13px; }

.contact-sheet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.contact-sheet button { display: block; width: 100%; padding: 0; border: var(--line); background: var(--wash); cursor: zoom-in; position: relative; }
.contact-sheet img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.contact-sheet .measure { position: absolute; left: 0; bottom: 0; background: var(--paper); border-top: var(--line); border-right: var(--line); padding: 2px 7px; color: var(--ink); }
.contact-sheet button:hover .measure, .contact-sheet button:focus-visible .measure { background: var(--red); color: #fff; }

dialog.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink); }
dialog.lightbox::backdrop { background: var(--paper); }
.lightbox-inner { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.lightbox-stage { position: relative; min-width: 0; min-height: 0; }
.lightbox-pan { width: 100%; height: 100%; overflow: hidden; }
.lightbox-pan:focus { outline: 0; }
.lightbox-pan > img { width: 100%; height: 100%; object-fit: contain; padding: clamp(12px, 2.5vw, 36px); }
.lightbox-bar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; padding: 12px var(--gutter); border-top: var(--line); }
.lightbox-count { font-weight: 500; }
.lightbox-buttons { grid-column: 2; display: flex; gap: 8px; }
/* With captions: the photo's number goes small, red and in the measuring face, with the caption under it on one line. */
.has-captions .lightbox-count { align-self: end; font-family: var(--mono); font-size: 0.8125rem; font-weight: 400; letter-spacing: -0.01em; line-height: 1.3; color: var(--red); }
.has-captions .lightbox-caption { grid-column: 1; grid-row: 2; align-self: start; min-height: 1.3em; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.has-captions .lightbox-buttons { grid-row: 1 / span 2; }
/* Narrow screens have no room for a caption beside four buttons, so it has the full width above them: up to two lines,
   and the space for two is always kept so the bar does not change height from one photo to the next. */
@media (max-width: 700px) {
  .has-captions .lightbox-caption { grid-column: 1 / -1; grid-row: 1; height: 2.6em; margin-bottom: 6px; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .has-captions .lightbox-count { grid-row: 2; align-self: center; }
  .has-captions .lightbox-buttons { grid-row: 2; }
}

/* On an upright phone a landscape photo opens as a tall slice of itself, filling the screen, and is dragged sideways
   (site.js sets data-view on the dialog: "close-up" or "whole"; it is absent on wide screens and for upright photos).
   The red length on the line above the bar shows which part of the photo is on screen. */
.lightbox-bar [data-lightbox-fit][hidden] { display: none; }
.lightbox-bar .icon-reduce, .lightbox[data-view="close-up"] .icon-enlarge { display: none; }
.lightbox[data-view="close-up"] .icon-reduce { display: block; }
.lightbox-where { position: absolute; left: 0; right: 0; top: -2px; height: 3px; pointer-events: none; visibility: hidden; }
.lightbox-where i { position: absolute; top: 0; bottom: 0; background: var(--red); }
.lightbox[data-view="close-up"] .lightbox-where { visibility: visible; }
.lightbox-hint { position: absolute; left: 12px; bottom: 12px; margin: 0; max-width: calc(100% - 24px); padding: 6px 10px; background: var(--paper); border: var(--line); font-size: 0.9375rem; line-height: 1.3; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.lightbox-hint.is-on { opacity: 1; }
.lightbox[data-view="whole"] .lightbox-pan { cursor: zoom-in; }
.lightbox[data-view="close-up"] .lightbox-pan {
  overflow-x: auto; overflow-y: hidden; touch-action: pan-x pinch-zoom; overscroll-behavior: contain;
  scrollbar-width: none; cursor: zoom-out;
}
.lightbox[data-view="close-up"] .lightbox-pan::-webkit-scrollbar { display: none; }
.lightbox[data-view="close-up"] .lightbox-pan { display: grid; grid-template: 100% / auto; justify-content: start; }
.lightbox[data-view="close-up"] .lightbox-pan > img,
.lightbox[data-view="close-up"] .lightbox-pan::before { grid-area: 1 / 1; width: auto; max-width: none; height: 100%; padding: 0; aspect-ratio: var(--photo-ratio, 1.5); object-fit: cover; }
/* an empty box the size of the photo: it keeps the full width to drag across while the photo itself is growing into place */
.lightbox[data-view="close-up"] .lightbox-pan::before { content: ""; }
@media (prefers-reduced-motion: reduce) { .lightbox-hint { transition: none; } }

.next-row { display: flex; justify-content: space-between; gap: 16px; border-top: var(--line); border-bottom: var(--line); }
.next-row a { padding: 20px 0; text-decoration: none; font-size: 1.375rem; font-weight: 500; line-height: 1.25; }
.next-row span { display: block; color: var(--mid); font-size: 0.9375rem; font-weight: 400; }
.next-row a:last-child { text-align: right; margin-left: auto; }

/* ---------- For architects ---------- (its Timescales strip is under "Timescales" at the end of this file) */
.details { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.details img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: var(--line); }
.details a { text-decoration: none; }
.details b { font-weight: 500; }
.details figcaption { color: var(--ink); }
.details figcaption span { display: block; color: var(--mid); }

.how { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 36px); }
.how li { border-top: var(--line); padding-top: 14px; }
.how h3 { font-size: 1.1875rem; font-weight: 500; line-height: 1.25; margin-bottom: 8px; }
.how .source { color: var(--mid); font-size: 0.9375rem; margin-top: 6px; }
.section-intro { max-width: 60ch; margin: -12px 0 28px; color: var(--mid); }

.cta { border: var(--line); padding: clamp(24px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 48px; align-items: end; }
.cta p { margin-top: 12px; max-width: 46ch; }
.cta .hero-actions { margin-top: 0; }
.page-head .hero-actions { margin-top: 24px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(56px, 8vw, 112px); border-top: var(--line); }
.footer-main { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; padding: 32px var(--gutter); }
.footer-main h2 { font-size: 0.9375rem; font-weight: 400; color: var(--mid); margin-bottom: 8px; letter-spacing: 0; }
.footer-main a { text-decoration: none; }
.footer-main a:hover { text-decoration: underline; }
.footer-main li { padding: 2px 0; }
.footer-main .m-mark { width: 44px; margin-bottom: 14px; }
.membership { display: flex; align-items: center; gap: 14px; margin-top: 22px; font-size: 0.9375rem; color: var(--mid); }
.footer-main .membership a { text-decoration: underline; }
.membership img { width: 54px; height: auto; flex: none; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 28px; padding: 14px var(--gutter) 24px; border-top: 1px solid var(--soft-line); color: var(--mid); font-size: 0.9375rem; }

/* ---------- Not found ---------- */
.not-found { padding: clamp(48px, 9vw, 128px) var(--gutter) 0; max-width: 900px; }
.not-found h1 { font-size: clamp(2.25rem, 5vw, 4rem); font-weight: 500; letter-spacing: -0.028em; line-height: 1; }
.not-found p { margin-top: 18px; max-width: 50ch; }

/* ---------- Tablets and phones ---------- */
@media (max-width: 1040px) {
  .site-header { gap: 14px 20px; padding-top: 14px; padding-bottom: 14px; }
  .logo img { width: 128px; }
  .header-phone { margin-left: auto; border: 0; padding: 0; order: 0; }
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 500; cursor: pointer;
    background: var(--paper); color: var(--ink); border: var(--line); padding: 8px 12px;
  }
  .menu-toggle svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .site-nav { margin: 0; width: 100%; order: 5; flex-basis: 100%; }
  .site-header { flex-wrap: wrap; }
  .site-nav ul { flex-direction: column; gap: 0; border-top: var(--line); margin-top: 4px; }
  .site-nav a { display: block; padding: 12px 0; border-bottom: 1px solid var(--soft-line); font-size: 1.125rem; }
  .site-nav li:last-child a { border-bottom: 0; }
  .details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-right: var(--gutter); }
  /* Phones: the headline comes first, then the drawing as a ruled sheet with a title block along its foot
     (name and address on the left, Isometric / Perspective on the right), then the paragraph and buttons.
     The page's HTML keeps its order; only the display order changes. Phones get the closer view of the building. */
  .hero-text { display: contents; }
  .hero h1 { order: -2; padding-top: 22px; max-width: 16ch; }
  .hero-drawing { order: -1; margin: 6px 0 0; border: var(--line); }
  .hero-dim { font-size: 0.625rem; padding: 0 3px; }
  /* The title block. */
  .hero-caption { position: relative; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: var(--line); min-height: 54px; }
  .hero-drawing figcaption { margin: 0; align-self: center; padding: 7px 10px 8px; font-size: min(0.6875rem, 2.8vw); line-height: 1.45; letter-spacing: -0.03em; white-space: nowrap; color: var(--mid); }
  .cap-name { display: block; color: var(--red); font-size: 0.8125rem; font-weight: 500; letter-spacing: -0.01em; }
  .cap-sep { display: none; }
  /* The right-hand cell is the switch. Until the live drawing takes over, and whenever it cannot run, the cell and
     the rule beside it are invisible (but keep their space), so the title block reads as one cell with the name
     and address in it; nothing moves when the switch arrives. */
  .hero-view { width: 112px; border-left: var(--line); font-size: 0.6875rem; line-height: 1.45; }
  .hero-view { position: relative; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding-left: 10px; }
  .hero-view > span { display: none; }
  .hero-view button { padding: 2px 0; line-height: 1.45; text-underline-offset: 3px; }
  /* The two words are too small to tap one at a time, so the whole cell is the button: a tap changes to the other view. */
  .hero-view button[aria-pressed="true"] { pointer-events: none; text-underline-offset: 3px; }
  .hero-view button[aria-pressed="false"]::after { content: ""; position: absolute; inset: 0; }
  /* The "this turns" mark sits in the bottom corner of the drawing rather than after the caption. */
  .hero-drag.in-caption { display: none; }
  .hero-drag.on-drawing { display: block; position: absolute; right: 8px; bottom: 8px; z-index: 2; padding: 4px 5px; background: rgba(255, 255, 255, 0.92); }
  /* The strip of details only works as one row. Below that it is left out: the phone number is in the header
     of every page and the address and email are in the footer. */
  .title-block { display: none; }
  .hero { gap: 14px; padding-top: 0; padding-bottom: 28px; border-bottom: var(--line); }
  .hero-text > p { margin-top: 8px; }
  .hero-actions { margin-top: 20px; gap: 10px; }
  #projects { padding-top: 36px; }
  .split, .split.text-first, .project-top, .cta { grid-template-columns: 1fr; }
  .quotes, .quotes.two, .team-cards { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 14px; }
  .contact-sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .site-plan text { font-size: 30px; }
  .site-plan text.road { font-size: 26px; }
  .team li { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 560px) {
  .project-grid { grid-template-columns: 1fr; }
  .contact-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; gap: 20px; }
  .contact-actions a { grid-template-columns: 1fr; gap: 0; }
  .menu-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .header-phone { font-size: 1rem; }
  .hero h1 { font-size: clamp(1.875rem, 7.7vw, 2.125rem); }
  .hero-actions .button { padding: 11px 14px; }
  .site-plan text { font-size: 36px; }
  .site-plan text.road { font-size: 30px; }
}

/* The very narrowest phones: the address in the title block may run to two lines. */
@media (max-width: 345px) {
  .hero-drawing figcaption { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-stage img { animation: none; }
  .hero-stage canvas, .hero-view { transition: none; }
  .hs-photos, .is-photo .hs-photos, .hs-slide, .hs-slide.is-current, .hs-slide img { transition: none; }
  .hs-progress { opacity: 0; }   /* the clock still runs if play is pressed; it just is not drawn */
  .hero-drawing.is-live .hero-drag svg { animation: none; }
}

/* ---------- Timescales ----------
   The Timescales page (src/templates/timescales.mjs): a list of every project with a recorded duration, with
   controls above it to show one kind of job or one size and to change the order (src/js/site.js runs them).
   Also here: the strip of four cells on For architects and the link on the Projects page.
   "ts" is short for timescales. */
.eyebrow { color: var(--mid); margin-bottom: 12px; }

/* The controls. Without JavaScript they are hidden and the whole list is shown. */
.ts-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px 40px; padding: 20px var(--gutter); border-bottom: var(--line); }
html:not(.js) .ts-controls { display: none; }
.ts-controls .label { display: block; color: var(--mid); font-size: 0.9375rem; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { font: inherit; font-weight: 500; padding: 7px 14px; background: transparent; color: var(--ink); border: var(--line); border-radius: 0; cursor: pointer; }
.chips button:hover { border-color: var(--red); }
.chips button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips .measure { margin-left: 6px; opacity: 0.75; }
.ts-select { font: inherit; font-weight: 500; color: var(--ink); background: var(--paper); border: var(--line); border-radius: 0; padding: 8px 12px; min-height: 42px; max-width: 100%; }
/* The line above the list: "6 of 24 projects. Time on site: 18 weeks to 10 months." */
.ts-readout { padding: 0 0 22px; }
.ts-empty { padding: 28px 0; }
.ts-empty button { font: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: inherit; }

/* The list: a table on wide screens, a list of cards on phones (further down). */
.ts-record { width: 100%; border-collapse: collapse; }
.ts-record caption { text-align: left; color: var(--mid); font-size: 0.9375rem; caption-side: bottom; padding-top: 14px; }
.ts-record th { text-align: left; font-weight: 400; color: var(--mid); font-size: 0.9375rem; padding: 0 20px 10px 0; border-bottom: var(--line); vertical-align: bottom; white-space: nowrap; }
.ts-record td { padding: 14px 20px 14px 0; border-bottom: 1px solid var(--soft-line); vertical-align: top; }
.ts-record th:last-child, .ts-record td:last-child { padding-right: 0; }
.ts-record tr[hidden] { display: none; }
.ts-record .thumb { width: 136px; }
.ts-record .thumb a { display: block; }
.ts-record .thumb img { width: 116px; aspect-ratio: 3 / 2; object-fit: cover; border: var(--line); background: var(--wash); }
.ts-record .name a { font-weight: 500; font-size: 1.125rem; text-decoration: none; }
.ts-record .name a:hover { text-decoration: underline; }
.ts-record .name span { display: block; color: var(--mid); font-size: 0.9375rem; }
.ts-record .scope { color: var(--mid); font-size: 0.9375rem; max-width: 46ch; }
.ts-record .scope b { display: block; color: var(--ink); font-weight: 400; }
.ts-record .time { width: 27%; min-width: 230px; }
.ts-record .area { white-space: nowrap; }
.ts-record .area small { display: block; font-family: "Jost", sans-serif; font-size: 0.875rem; color: var(--mid); }
.ts-record .none { color: var(--mid); font-size: 0.9375rem; }
/* Every bar is drawn on the same scale, 0 to 45 weeks (SCALE_WEEKS in timescales.mjs), with a faint mark every
   10 weeks: 10 / 45 = 22.2222%. */
.ts-track { display: block; height: 9px; margin-top: 7px; background: repeating-linear-gradient(to right, var(--soft-line) 0 1px, transparent 1px 22.2222%); }
.ts-track i { display: block; height: 7px; min-width: 2px; background: var(--ink); }
.ts-axis { position: relative; display: block; height: 1.2em; margin-top: 4px; font-family: var(--mono); font-size: 0.6875rem; color: var(--mid); }
.ts-axis span { position: absolute; top: 0; white-space: nowrap; }

/* "How to read these figures". */
.ts-notes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 36px); }
.ts-notes li { border-top: var(--line); padding-top: 14px; }
.ts-notes h3 { font-size: 1.1875rem; font-weight: 500; line-height: 1.25; margin-bottom: 8px; }
.ts-notes p { color: var(--mid); font-size: 0.9375rem; }

/* For architects: one card for each kind of job, each a link to the Timescales page. The red line is that kind's
   range, shortest to longest, on the same 0 to 45 week scale as the bars on the Timescales page; the faint marks
   are every 10 weeks. */
.ts-glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 26px); }
.ts-glance a { display: block; text-decoration: none; color: inherit; }
.ts-glance img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: var(--line); margin-bottom: 14px; }
.ts-glance .kind { display: block; font-weight: 500; }
.ts-glance .range { display: block; font-family: var(--mono); font-size: clamp(1.125rem, 1.65vw, 1.5rem); letter-spacing: -0.03em; margin-top: 4px; }
.ts-span { display: block; position: relative; height: 13px; margin: 10px 0 8px;
  background: linear-gradient(var(--soft-line), var(--soft-line)) 0 50% / 100% 1px no-repeat,
              repeating-linear-gradient(90deg, var(--soft-line) 0 1px, transparent 1px 22.222%) 0 50% / 100% 7px no-repeat; }
.ts-span i { position: absolute; top: 50%; height: 2px; margin-top: -1px; min-width: 2px; background: var(--red); }
.ts-span i::before, .ts-span i::after { content: ""; position: absolute; top: -5px; width: 2px; height: 12px; background: var(--red); }
.ts-span i::before { left: 0; }
.ts-span i::after { right: 0; }
.ts-glance .n { display: block; color: var(--mid); font-size: 0.9375rem; }
.ts-glance .go { display: inline-block; margin-top: 10px; font-size: 0.9375rem; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.ts-glance .go::after { content: " \2192"; }
.ts-glance a:hover .range, .ts-glance a:hover .go { color: var(--red); }
.ts-after { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 22px; }
.ts-after p { color: var(--mid); font-size: 0.9375rem; max-width: 60ch; }
/* Projects: the link in the bar with the Extensions / Lofts / New builds lens. */
.ts-lenslink { font-weight: 500; }

@media (max-width: 1040px) {
  .ts-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ts-record .scope { max-width: 34ch; }
}
@media (max-width: 860px) {
  .ts-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  /* The list becomes cards: the photo on the left with the name, town and area beside it, then the scope and the bar. */
  .ts-record thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ts-record { display: flex; flex-direction: column; }
  .ts-record caption { order: 9; }
  .ts-record tbody, .ts-record td, .ts-record caption { display: block; }
  .ts-record tr { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--soft-line); }
  .ts-record tr[hidden] { display: none; }
  .ts-record td { border: 0; padding: 0; }
  .ts-record .thumb { width: auto; grid-row: 1 / span 2; }
  .ts-record .thumb img { width: 104px; }
  .ts-record .area { grid-column: 2; margin-top: 2px; }
  .ts-record .area small { display: inline; margin-left: 6px; }
  .ts-record td.area:not(.blank)::before { content: "Area: "; font-family: "Jost", sans-serif; color: var(--mid); }
  .ts-record .scope, .ts-record .time { grid-column: 1 / -1; }
  .ts-record .scope { order: 3; max-width: none; margin-top: 10px; }
  .ts-record .time { order: 4; width: auto; min-width: 0; margin-top: 8px; }
}
@media (max-width: 560px) {
  .ts-notes { grid-template-columns: 1fr; }
  .ts-controls { gap: 14px 16px; }
  .ts-controls .group.half { flex: 1 1 40%; min-width: 0; }
  .ts-controls .group.half .ts-select { width: 100%; }
  .chips button { padding: 7px 11px; }
  .ts-glance .range { font-size: 1.0625rem; }
}

/* ---------- Where we work (/areas/): the drawn map of towns, then the projects in each ---------- */
.areas-map-section { padding-top: clamp(24px, 3vw, 40px); }
.areas-map { margin: 0; border: var(--line); }
.areas-map svg { display: block; width: 100%; height: auto; font-family: "Jost", sans-serif; }
.areas-map svg.narrow { display: none; }
.areas-map .ring { fill: none; stroke: var(--soft-line); stroke-width: 1; stroke-dasharray: 3 5; }
.areas-map .ring-label, .areas-map .scale text, .areas-map .north text { font-family: var(--mono); font-size: 0.8em; fill: var(--mid); }
.areas-map text { fill: var(--ink); font-weight: 500; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.areas-map .num { font-family: var(--mono); font-weight: 400; fill: var(--mid); }
.areas-map .town { fill: var(--ink); stroke: var(--paper); stroke-width: 1.5; }
.areas-map a:hover .town, .areas-map a:focus-visible .town { fill: var(--red); }
.areas-map a:hover text, .areas-map a:focus-visible text { fill: var(--red); }
.areas-map a:focus-visible { outline: none; }
.areas-map .office rect { fill: var(--red); }
.areas-map .office text { fill: var(--red); }
.areas-map .scale path, .areas-map .north path { fill: none; stroke: var(--ink); stroke-width: 1; }
.areas-map figcaption { display: flex; flex-wrap: wrap; gap: 4px 24px; border-top: var(--line); padding: 10px 14px; font-size: 0.9375rem; }
.areas-map figcaption b { font-weight: 500; }
.areas-map figcaption span { color: var(--mid); }
.areas-towns { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 24px clamp(20px, 3vw, 48px); margin-top: clamp(28px, 4vw, 48px); }
.areas-towns h3 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.015em; }
.areas-towns .intro p { color: var(--mid); margin-top: 10px; max-width: 38ch; }
.areas-towns .intro .key { font-size: 0.875rem; }
.areas-towns h4 { font-family: var(--mono); font-size: 0.8125rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mid); padding-bottom: 8px; margin-bottom: 8px; border-bottom: var(--line); }
.areas-towns ul { list-style: none; margin: 0; padding: 0; }
.areas-towns li { padding: 2px 0; }
.areas-towns li a { font-weight: 600; text-decoration: none; }
.areas-towns li a:hover { color: var(--red); }
@media (max-width: 1000px) { .areas-towns { grid-template-columns: repeat(2, 1fr); } .areas-towns .intro { grid-column: 1 / -1; } }
.areas-list .area { padding-top: clamp(28px, 4vw, 48px); scroll-margin-top: 90px; }
.areas-list .area h3 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.015em; padding-bottom: 10px; margin-bottom: 20px; border-bottom: var(--line); display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.areas-list .area h3 .measure { color: var(--mid); font-weight: 400; }
.areas-list .area .card h3 { font-size: 1.25rem; border: 0; padding: 0; margin-bottom: 0; display: block; }
.areas-missing { margin-top: clamp(28px, 4vw, 48px); color: var(--mid); }
@media (max-width: 700px) {
  .areas-map svg.wide { display: none; }
  .areas-map svg.narrow { display: block; }
}
