/* ---------------------------------------------------------------
   Douglas Sparks — portfolio
   One neutral grotesque, two weights doing the work: 200 for
   everything, 900 for names. Greyscale interface; the objects
   supply the colour.
   --------------------------------------------------------------- */

:root {
  --ink:        #292a2c;
  --body:       #55534d;
  --muted:      #9a9a95;
  --faint:      #b4b1aa;
  --hairline:   #e4e2dc;
  --tile:       #f1f0ed;
  --band:       #f7f7f6;
  --page:       #ffffff;
  --edge:       24px;
  --gutter:     30px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 200;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; }

/* ── masthead ──────────────────────────────────────────────── */

.masthead {
  background: var(--band);
  padding: 40px 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wordmark {
  font-size: 23px;
  font-weight: 200;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 56px;
  margin-top: 16px;
  font-size: 15px;
}

.nav a { color: var(--muted); transition: color 160ms ease; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
}

/* Contact is a mailto link; hover, focus or a click shows the address
   (with Copy) and LinkedIn in a small card under the nav */
.nav { position: relative; }
.contact-pop {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 20;
  padding-top: 14px;   /* hover bridge from the link down to the card */
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -4px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms;
}
.contact:hover .contact-pop,
.contact:focus-within .contact-pop,
.contact.is-open .contact-pop {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}
.contact-card {
  display: flex;
  align-items: baseline;
  padding: 12px 18px;
  background: var(--page);
  border: 1px solid var(--hairline);
  box-shadow: 0 8px 28px rgba(41, 42, 44, 0.06);
  font-size: 14px;
}
.contact-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.contact-copy-label {
  min-width: 6.4em;
  text-align: left;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 160ms ease;
}
.contact-copy:hover .contact-copy-label { color: var(--ink); }
.nav .contact-linkedin {
  margin-left: 6px;
  padding-left: 18px;
  border-left: 1px solid var(--hairline);
}

.label {
  font-size: 11px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── grid ──────────────────────────────────────────────────── */

/* one quiet row between the masthead and the grid: what to show on the
   left, the order on the right, set like the nav */
.grid-controls {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px 32px;
  flex-wrap: wrap;
  padding: 40px var(--edge) 0;
}

.grid-filter,
.grid-sort { display: flex; gap: 26px; flex-wrap: wrap; }

.grid-controls button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  padding: 0 0 3px;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: color 160ms ease;
}

.grid-controls button:hover { color: var(--ink); }
.grid-controls button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.grid-controls button[hidden] { display: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gutter);
  padding: 28px var(--edge) 0;
}

.tile-link { display: block; }

.tile {
  position: relative;
  display: block;
  background: var(--tile);
  aspect-ratio: 447 / 319;
  overflow: hidden;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 22px;
  transition: filter 300ms ease;
}

.tile-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 0 20px;
  text-align: center;
  color: #fff;
  opacity: 0;
  transition: opacity 300ms ease;
}

.tile-label .name { font-size: 27px; font-weight: 900; line-height: 1; }
.tile-label .desc { font-size: 18px; font-weight: 200; line-height: 1.3; }

.tile:hover img,
.tile:focus-visible img { filter: blur(7px) brightness(0.62); }

.tile:hover .tile-label,
.tile:focus-visible .tile-label { opacity: 1; }

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

.grid-empty {
  grid-column: 1 / -1;
  padding: 80px 0;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}

.tile-caption { display: none; }

.tile-caption .name {
  display: block;
  font-size: 17px;
  font-weight: 900;
  margin-top: 14px;
  line-height: 1.2;
}

.tile-caption .desc {
  display: block;
  font-size: 15px;
  margin-top: 5px;
  line-height: 1.4;
  color: var(--body);
}

/* ── responsive ────────────────────────────────────────────── */

@media (max-width: 820px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav { gap: 48px; }
}

@media (max-width: 680px) {
  :root { --edge: 16px; --gutter: 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .masthead { padding: 26px 0 22px; }
  .nav { gap: 40px; margin-top: 12px; font-size: 14px; }
  .contact-card { padding: 11px 14px; font-size: 13px; }
  .contact-copy { gap: 10px; }
  .nav .contact-linkedin { padding-left: 14px; }
  .wordmark { font-size: 18px; letter-spacing: 1.8px; }
  .grid-controls { padding-top: 22px; row-gap: 12px; }
  .grid-filter, .grid-sort { gap: 18px; }
  .grid-controls button { font-size: 14px; }
  .grid { padding-top: 20px; }
  .tile-label .name { font-size: 21px; }
  .tile-label .desc { font-size: 15px; }
  /* touch devices have no hover: show labels under the tile instead */
  .tile img { filter: none !important; }
  .tile-label { display: none; }
  .tile-caption { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── project page ──────────────────────────────────────────── */

.hero { width: 100%; height: 604px; object-fit: cover; display: block; }

.wrap { padding: 0 var(--edge); }

.project-title {
  padding-top: 84px;
}

.project-title .name {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.05;
}

.project-title .desc {
  display: block;
  font-size: 18px;
  margin-top: 11px;
}

.cols {
  display: grid;
  grid-template-columns: 210px minmax(0, 790px);
  gap: 56px;
  padding-top: 56px;
}

.meta { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--body); }
.meta .dim { color: var(--muted); }
.meta-group { margin-top: 34px; }
.meta-group .label { display: block; margin-bottom: 14px; }

.prose { font-size: 16px; line-height: 1.62; color: var(--body); margin: 0; }
.prose + .prose { margin-top: 20px; }
.prose.lead { color: var(--ink); font-weight: 400; }

.chapter-rule { height: 1px; background: var(--hairline); margin-top: 92px; }

.chapter {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-top: 30px;
}

.chapter-mark { display: flex; align-items: baseline; gap: 20px; }
.chapter-mark .num { font-size: 30px; font-weight: 100; color: var(--faint); line-height: 1; }
.chapter-jump { font-size: 15px; color: var(--muted); white-space: nowrap; }
.chapter-jump:hover { color: var(--ink); }

.section-heading {
  display: block;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
  margin-top: 56px;
}
.section-heading:first-child { margin-top: 0; }
.section-heading + .prose,
.section-heading + .points { margin-top: 16px; }

.points { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.points li { font-size: 16px; line-height: 1.55; color: var(--body); }

.metric {
  margin-top: 26px;
  padding-left: 16px;
  border-left: 2px solid var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.figure { margin-top: 30px; }
.figure img { width: 100%; height: 424px; object-fit: cover; display: block; }
.figure.contain img { object-fit: contain; height: 320px; }
.figcap { display: block; font-size: 13px; color: var(--faint); margin-top: 11px; line-height: 1.5; }

.figure-2up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 30px; }
.figure-2up .figure { margin-top: 0; }
.figure-2up img { height: 268px; }

/* ── editorial project page ───────────────────────────────── */

.editorial-project-page {
  --case-edge: clamp(24px, 7vw, 96px);
  background: #fff;
}

.editorial-hero {
  position: relative;
  display: grid;
  /* pin the single cell to the hero's own height, otherwise the auto row
     grows to the photo's natural size and the 94% below never applies */
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  min-height: 560px;
  height: calc(100svh - 133px);
  overflow: hidden;
  background: #f4f3f0;
}

.editorial-hero video,
.editorial-hero img {
  width: 94%;
  height: 94%;
  object-fit: contain;
  animation: swan-hero-in 950ms cubic-bezier(.2,.7,.2,1) both;
}

.editorial-scroll {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 42px;
  height: 42px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
}

.editorial-scroll span {
  width: 18px;
  height: 18px;
  border-right: 1px solid #77746e;
  border-bottom: 1px solid #77746e;
  transform: rotate(45deg) translate(-3px, -3px);
}

.case-wrap {
  width: calc(100% - (2 * var(--case-edge)));
  max-width: 1180px;
  margin-inline: auto;
}

.editorial-intro {
  padding-top: 96px;
  padding-bottom: 126px;
}

.editorial-eyebrow,
.editorial-outcome-label {
  display: block;
  margin-bottom: 28px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}

.editorial-title-row {
  padding-bottom: 30px;
  border-bottom: 1px solid var(--hairline);
}

.editorial-title-row h1 {
  margin: 0;
  font-size: clamp(46px, 7vw, 82px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: .92;
}

.editorial-subtitle {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.3;
}

.editorial-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(220px, .65fr);
  gap: clamp(64px, 10vw, 150px);
  align-items: start;
  padding-top: 44px;
}

.editorial-intro-copy {
  max-width: 760px;
  margin: 0;
  color: #494944;
  font-size: clamp(21px, 2.25vw, 30px);
  font-weight: 200;
  line-height: 1.47;
  letter-spacing: -0.015em;
}

.editorial-facts {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 5px;
  color: var(--body);
  font-size: 14px;
  line-height: 1.5;
}

.editorial-section {
  padding: 42px 0 132px;
  border-top: 1px solid var(--hairline);
}

.editorial-section-head {
  display: grid;
  grid-template-columns: 220px minmax(0, 720px);
  gap: 52px;
  align-items: start;
}

.editorial-index {
  display: flex;
  align-items: baseline;
  gap: 18px;
  color: var(--faint);
  text-transform: uppercase;
}

.editorial-index span:first-child {
  font-size: 31px;
  font-weight: 100;
}

.editorial-index span:last-child {
  font-size: 11px;
  letter-spacing: 1.8px;
}

.editorial-section-copy h2,
.editorial-outcome h2 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(33px, 4vw, 53px);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

.editorial-section-copy p,
.editorial-outcome-grid p {
  max-width: 670px;
  margin: 25px 0 0;
  color: var(--body);
  font-size: 17px;
  line-height: 1.68;
}

.editorial-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  margin-top: 64px;
}

.editorial-media-grid.media-count-1 { grid-template-columns: minmax(0, 1fr); }
.editorial-media-grid.media-count-3 .featured { grid-column: 1 / -1; }

.editorial-media { margin: 0; }

.editorial-media-frame {
  height: clamp(330px, 45vw, 600px);
  overflow: hidden;
  background: #f1f2f1;
}

.editorial-media.featured .editorial-media-frame {
  height: clamp(500px, 69vw, 820px);
}

.editorial-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 800ms cubic-bezier(.2,.7,.2,1);
}

.editorial-media:hover img { transform: scale(1.012); }

.editorial-media.contain .editorial-media-frame { background: #e9eef4; }
.editorial-media.contain img { object-fit: contain; }

.editorial-media figcaption {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.editorial-media figcaption span { color: var(--faint); }

.editorial-outcome {
  padding: 116px 0 124px;
  background: #f5f4f1;
}

.editorial-outcome-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .75fr);
  gap: clamp(70px, 10vw, 150px);
  align-items: start;
}

.editorial-outcome-grid p { margin-top: 4px; font-size: 20px; }

.editorial-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 90px;
  border-top: 1px solid #d9d7d1;
  border-bottom: 1px solid #d9d7d1;
}

.editorial-metric {
  min-height: 150px;
  padding: 30px 28px 28px 0;
}

.editorial-metric + .editorial-metric {
  padding-left: 30px;
  border-left: 1px solid #d9d7d1;
}

.editorial-metric .value {
  display: block;
  font-size: clamp(31px, 4vw, 52px);
  font-weight: 900;
  letter-spacing: -0.045em;
}

.editorial-metric .caption {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.editorial-report {
  display: inline-flex;
  align-items: baseline;
  gap: 18px;
  margin-top: 42px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--ink);
  font-size: 15px;
}

.editorial-report span { color: var(--muted); }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 650ms ease, transform 800ms cubic-bezier(.2,.7,.2,1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes swan-hero-in {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 860px) {
  .editorial-hero { min-height: 460px; height: calc(82svh - 110px); }
  .editorial-intro-grid,
  .editorial-outcome-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .editorial-section-head { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .editorial-media-grid { gap: 18px; }
}

@media (max-width: 680px) {
  .editorial-project-page { --case-edge: 16px; }
  /* a landscape photo on a portrait screen: let it run edge to edge at its
     own aspect rather than floating in a tall empty band */
  .editorial-hero { min-height: 0; height: auto; }
  .editorial-hero img,
  .editorial-hero video { width: 100%; height: auto; }
  .editorial-hero .slot { width: 100%; height: auto; aspect-ratio: 3 / 2; }
  .editorial-hero .editorial-scroll { display: none; }
  .editorial-intro { padding-top: 64px; padding-bottom: 88px; }
  .editorial-title-row h1 { font-size: 44px; }
  .editorial-intro-copy { font-size: 21px; }
  .editorial-section { padding: 32px 0 88px; }
  .editorial-section-copy p { font-size: 16px; }
  .editorial-media-grid,
  .editorial-media-grid.media-count-3 { grid-template-columns: minmax(0, 1fr); margin-top: 44px; }
  .editorial-media-grid.media-count-3 .featured { grid-column: auto; }
  .editorial-media-frame,
  .editorial-media.featured .editorial-media-frame { height: 320px; }
  .editorial-outcome { padding: 78px 0 86px; }
  .editorial-metrics { grid-template-columns: minmax(0, 1fr); margin-top: 58px; }
  .editorial-metric { min-height: 0; padding: 24px 0; }
  .editorial-metric + .editorial-metric { padding-left: 0; border-left: 0; border-top: 1px solid #d9d7d1; }
}

@media (prefers-reduced-motion: reduce) {
  .editorial-hero img,
  .editorial-hero video { animation: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ── chapter layout: a MUJI-style case study built from numbered
   chapters. Images sit on a six-column grid that runs nearly edge to
   edge; copy starts on a column line and is inset from it, so every
   block of text shares a few vertical axes. Measured against
   heinrichzaunschirm.com/project/muji-screwdriver at 1440px: 53px heads,
   32px block titles, 18px extra-light body, 20px gaps, 118px inset. ── */

.editorial-chapters,
.experience-page {
  --ch-gap: 20px;
  --inset: clamp(0px, 8.2vw, 118px);
}

.editorial-intro-copy p { margin: 0; }
.editorial-intro-copy p + p { margin-top: 1em; }

/* intro: title, two short paragraphs and the facts, on the same axes */
.editorial-chapters .editorial-intro {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 88px var(--edge) 0;
}

.editorial-chapters .editorial-title-row { margin-inline: var(--inset); padding-bottom: 26px; }

.editorial-chapters .editorial-title-row h1 {
  font-size: clamp(38px, 3.7vw, 53px);
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.editorial-chapters .editorial-subtitle { margin-top: 4px; font-size: 20px; }

.editorial-chapters .editorial-intro-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0 var(--ch-gap);
  padding-top: 42px;
}

.editorial-chapters .editorial-intro-copy,
.editorial-chapters .editorial-facts {
  padding-left: var(--inset);
  color: var(--ink);
  font-size: 18px;
  font-weight: 200;
  line-height: 1.5;
  letter-spacing: 0;
}

.editorial-chapters .editorial-intro-copy { grid-column: 1 / 4; max-width: none; }
.editorial-chapters .editorial-intro-copy p { max-width: 453px; }
.editorial-chapters .editorial-facts { grid-column: 4 / 7; gap: 0; padding-top: 0; }

/* an image, or the labelled frame standing in for one */
.slot { position: relative; overflow: hidden; background: var(--tile); }
.slot img,
.slot video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* drawings and charts sit whole on the page's own white */
.slot.contain { background: #fff; }
.slot.contain img { object-fit: contain; }

/* charts: greyscale, hairline grid, the page's own type */
.slot.chart { background: #fff; }
.slot.chart svg { display: block; overflow: visible; font-family: inherit; }
.slot.chart .grid { stroke: var(--hairline); stroke-width: 1; }
.slot.chart .base { stroke: #cfcdc6; stroke-width: 1; }
.slot.chart .tick { fill: var(--muted); font-size: 12px; }
.slot.chart .axis { fill: var(--muted); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; }
.slot.chart .line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.slot.chart .dot { fill: #fff; stroke: var(--ink); stroke-width: 1.5; }
.slot.chart .err { stroke: #b4b1aa; stroke-width: 1; }
.slot.chart .bar { fill: var(--ink); }
.slot.chart .value { fill: var(--ink); font-size: 14px; font-weight: 900; }
.slot.chart .mark { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 4; }
.slot.chart .area { fill: #f1f0ed; }
.slot.chart .line.alt { stroke: #b4b1aa; }
.slot.chart .dot.alt { stroke: #b4b1aa; }
.slot.chart .series-label { fill: var(--ink); font-size: 12px; font-weight: 900; }
.slot.chart .series-label.alt { fill: var(--muted); }
.slot.chart .edge { stroke: #b4b1aa; stroke-width: 1; stroke-dasharray: 2 4; }
.slot.chart .edge-label { fill: var(--muted); font-size: 11px; }
.slot.chart .mark-label { fill: var(--ink); font-size: 12px; }
.slot.is-empty { display: grid; place-items: center; }

.slot-label {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 0 24px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 2.2px;
  text-align: center;
  text-transform: uppercase;
}

.slot-label span { letter-spacing: 1px; }

.editorial-hero .slot { width: 94%; height: 94%; background: #ebe9e4; }

/* chapters */
.ch { padding: 150px var(--edge) 0; }

.ch-head {
  margin: 0 var(--inset) 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--hairline);
}

.ch-num,
.ch-head h2 {
  display: block;
  font-size: clamp(38px, 3.7vw, 53px);
  line-height: 1.25;
}

.ch-num { font-weight: 100; }
.ch-head h2 { margin: 0; font-weight: 900; letter-spacing: -0.015em; text-transform: uppercase; }

.ch-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--ch-gap);
}

.ch-block + .ch-block { margin-top: 120px; }
.is-media + .is-media { margin-top: var(--ch-gap); }
.is-media + .is-text { margin-top: 56px; }
.ch-flow + .ch-block { margin-top: 72px; }

.ch-figure { margin: 0; }
.ch-figure .slot { aspect-ratio: 16 / 9; }
.ch-figure figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; }

.col-full { grid-column: 1 / -1; }
.col-half { grid-column: span 3; }
.col-third { grid-column: span 2; }

.ch-text { padding-left: var(--inset); }

.ch-text h3 {
  max-width: 380px;
  margin: 0;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.ch-text p {
  max-width: 380px;
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 200;
  line-height: 1.5;
}

.ch-text p + p { margin-top: 0.9em; }

.col-left { grid-column: 1 / 4; }
.col-right { grid-column: 4 / 7; }

.cols-1 > .ch-text { grid-column: 1 / 4; }
.cols-2 > .ch-text:nth-child(1) { grid-column: 1 / 4; }
.cols-2 > .ch-text:nth-child(2) { grid-column: 4 / 7; }
.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 56px;
  margin-inline: var(--inset);
}

.cols-3 > .ch-text:nth-child(n) { grid-column: auto; padding-left: 0; }

/* image beside copy, the copy centred on the image */
.is-split > * { grid-row: 1; align-self: center; }
.media-left-3 > .ch-figure { grid-column: 1 / 4; }
.media-left-3 > .ch-text { grid-column: 4 / 7; }
.media-left-4 > .ch-figure { grid-column: 1 / 5; }
.media-left-4 > .ch-text { grid-column: 5 / 7; padding-left: 0; padding-right: var(--inset); }
.media-right-3 > .ch-figure { grid-column: 4 / 7; }
.media-right-3 > .ch-text { grid-column: 1 / 4; }
.media-right-4 > .ch-figure { grid-column: 3 / 7; }
.media-right-4 > .ch-text { grid-column: 1 / 3; padding-right: calc(var(--inset) / 2); }

/* the last word: one bold line beside the final image */
.ch-statement .label { display: block; margin-bottom: 16px; }
.ch-statement .editorial-report { margin-top: 32px; }
.is-text > .ch-statement { grid-column: 1 / 5; }

.ch-statement p {
  max-width: 460px;
  margin: 0;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.ch-stats {
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  column-gap: 40px;
  margin-inline: var(--inset);
}

.ch-stats > div { padding-top: 20px; border-top: 1px solid var(--hairline); }
.stat-value { display: block; font-size: 32px; font-weight: 900; letter-spacing: -0.015em; line-height: 1.15; }
.stat-label { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* plant level -> fabrication, drawn as a track */
.ch-flow {
  display: grid;
  grid-template-columns: repeat(var(--steps, 4), minmax(0, 1fr));
  margin: 0 var(--inset);
  padding: 0;
  list-style: none;
}

.ch-head + .ch-flow { margin-top: 64px; }

.ch-flow li {
  position: relative;
  padding: 22px 20px 0 0;
  border-top: 1px solid #cfcdc6;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.ch-flow li::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.ch-flow li:last-child::after {
  content: "";
  position: absolute;
  top: -5px;
  right: 1px;
  width: 9px;
  height: 9px;
  border-top: 1px solid #cfcdc6;
  border-right: 1px solid #cfcdc6;
  transform: rotate(45deg);
}

/* related tiles on the same six columns as the page above */
body.editorial-chapters .related { width: auto; max-width: none; margin: 0; padding-inline: var(--edge); }
body.editorial-chapters .related-head { margin-inline: var(--inset); }
body.editorial-chapters .rail { gap: var(--ch-gap); grid-auto-columns: calc((100% - 5 * var(--ch-gap)) / 6); }

@media (max-width: 1024px) {
  .is-split { row-gap: 36px; }
  .is-split > * { grid-row: auto; }
  .is-split > .ch-figure { grid-column: 1 / -1; }
  .is-split > .ch-text { grid-column: 1 / 5; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
  .ch-text h3,
  .ch-statement p { font-size: 28px; }
  body.editorial-chapters .rail { grid-auto-columns: calc((100% - 2 * var(--ch-gap)) / 3); }
}

@media (max-width: 680px) {
  .editorial-chapters,
  .experience-page { --inset: 0px; --ch-gap: 12px; }
  .editorial-chapters .editorial-intro { padding-top: 56px; }
  .editorial-chapters .editorial-intro-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 32px; }
  .editorial-chapters .editorial-intro-copy,
  .editorial-chapters .editorial-facts { grid-column: 1 / -1; font-size: 17px; font-weight: 300; }
  .ch { padding-top: 104px; }
  .ch-num,
  .ch-head h2 { font-size: 36px; }
  .ch-grid,
  .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .ch-head + .ch-flow { margin-top: 40px; }
  .ch-grid > .ch-figure:nth-child(n),
  .ch-grid > .ch-text:nth-child(n) { grid-column: 1 / -1; grid-row: auto; }
  .is-text,
  .is-split { row-gap: 32px; }
  .ch-block + .ch-block { margin-top: 72px; }
  .is-media + .is-text { margin-top: 32px; }
  .ch-flow + .ch-block { margin-top: 48px; }
  .ch-text h3 { font-size: 24px; }
  .ch-text p { font-size: 17px; font-weight: 300; }
  .ch-statement p { font-size: 26px; font-weight: 900; }
  /* a wide chart would be a thin strip on a phone: give it room to read */
  /* width pinned, or the aspect ratio would widen the chart to meet the minimum height */
  .slot.chart { width: 100%; min-height: 240px; }
  .ch-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .ch-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .ch-stats.is-wide { grid-template-columns: minmax(0, 1fr); }
  .stat-value { font-size: 26px; }
  body.editorial-chapters .rail { grid-auto-columns: calc((100% - var(--ch-gap)) / 2); }
}

/* ── related projects ──────────────────────────────────────── */

.related { padding: 104px var(--edge) 120px; }

/* on a case study, sit in the same centred column as the story above */
.editorial-project-page .related {
  width: calc(100% - (2 * var(--case-edge)));
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 0;
}

.related-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}

.related-arrows { display: flex; gap: 8px; }

.rail-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #f4f3f1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 0;
  cursor: pointer;
}
.rail-arrow svg { width: 12px; height: 12px; stroke: #6f6d67; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rail-arrow:disabled { opacity: 0.35; cursor: default; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 5 * var(--gutter)) / 6);
  gap: var(--gutter);
  padding-top: 36px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.rail .tile { aspect-ratio: 207 / 150; }
.rail .tile img { padding: 16px; }
.rail .tile-label { display: none; }
.rail .tile-caption { display: block; text-align: center; }
.rail .tile-caption .name { font-size: 13px; margin-top: 16px; }
.rail .tile-caption .desc { font-size: 13px; margin-top: 6px; }

@media (max-width: 1080px) {
  .cols { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .rail { grid-auto-columns: calc((100% - 2 * var(--gutter)) / 3); }
  .hero { height: 420px; }
}

@media (max-width: 680px) {
  .hero { height: 280px; }
  .project-title { padding-top: 48px; }
  .figure img { height: 240px; }
  .figure-2up { grid-template-columns: minmax(0, 1fr); }
  .figure-2up img { height: 240px; }
  .rail { grid-auto-columns: calc((100% - var(--gutter)) / 2); }
  .chapter { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ── experience page: a CV on the site's grid. Dates sit in a narrow
   left column and every entry hangs off the same line to its right, so
   the page scans like a table of contents. Each role ends in the
   projects done there, as small studio tiles linking to the case study. */

.experience-page { --case-edge: clamp(24px, 7vw, 96px); }
.experience-page main {
  width: calc(100% - (2 * var(--case-edge)));
  max-width: 1180px;
  margin: 0 auto;
  padding: 88px 0 160px;
  --when: 200px;
  --xp-gap: 56px;
}

/* four facts first: what, where, qualified, work rights */
.xp-glance {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1fr 0.7fr;
  gap: 32px;
  margin: 0;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--hairline);
}
.xp-glance dt,
.xp-facts dt,
.xp-also .label {
  font-size: 11px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--faint);
}
.xp-glance dd {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
}

.xp-section { padding-top: 120px; }

.xp-heading {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 0 0 8px;
  font-size: clamp(30px, 2.8vw, 40px);
  font-weight: 900;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.xp-heading span { font-weight: 100; letter-spacing: 0; }

.xp-entry {
  display: grid;
  grid-template-columns: var(--when) minmax(0, 1fr);
  column-gap: var(--xp-gap);
  padding: 44px 0 48px;
  border-top: 1px solid var(--hairline);
}
.xp-heading + .xp-entry { border-top-color: var(--ink); }

.xp-when {
  padding-top: 9px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.xp-when span { display: block; color: var(--faint); }

.xp-main { min-width: 0; }
.xp-main h3 {
  margin: 0;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.xp-role {
  margin: 6px 0 0;
  font-size: 18px;
  color: var(--muted);
}

.xp-points,
.xp-summary {
  max-width: 44em;
  margin: 24px 0 0;
  padding: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--body);
}
.xp-points { list-style: none; }
.xp-points li { position: relative; padding-left: 22px; }
.xp-points li + li { margin-top: 8px; }
.xp-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 10px;
  border-top: 1px solid var(--faint);
}

.xp-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  max-width: 44em;
  margin: 28px 0 0;
}
.xp-facts dd {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-line;
  color: var(--body);
}

/* one moving image per role at most, as wide as the tiles under it */
.xp-media { margin: 34px 0 0; }
.xp-frame { aspect-ratio: 16 / 9; overflow: hidden; background: var(--tile); }
.xp-frame video,
.xp-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xp-media figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* the work, as small tiles */
.xp-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 16px;
  margin-top: 34px;
}
.xp-proj { display: block; }
.xp-thumb {
  display: block;
  aspect-ratio: 1.4;
  overflow: hidden;
  background: var(--tile);
}
.xp-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(.2, .7, .2, 1);
}
.xp-proj:hover .xp-thumb img { transform: scale(1.04); }
.xp-proj-name {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 160ms ease;
}
.xp-proj:hover .xp-proj-name { color: var(--ink); }

.xp-textlinks { margin: 26px 0 0; font-size: 16px; }
.xp-textlinks a {
  color: var(--ink);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
  transition: border-color 160ms ease;
}
.xp-textlinks a:hover { border-color: var(--ink); }

/* short roles, one line each */
.xp-also {
  padding: 30px 0 8px;
  border-top: 1px solid var(--hairline);
}
.xp-also .label { margin: 0 0 14px; }
.xp-also-row {
  display: grid;
  grid-template-columns: var(--when) minmax(0, 1fr);
  column-gap: var(--xp-gap);
  padding: 6px 0;
}
.xp-also-row .xp-when { padding-top: 2px; }
.xp-also-what { font-size: 17px; color: var(--ink); }
.xp-also-what span { color: var(--muted); }
.xp-also-what span::before { content: " · "; }

@media (max-width: 1024px) {
  .experience-page main { --when: 150px; --xp-gap: 36px; }
  .xp-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .xp-projects { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 680px) {
  .experience-page { --case-edge: 16px; }
  .experience-page main { padding: 48px 0 110px; }
  .xp-glance { gap: 22px 16px; padding-bottom: 32px; }
  .xp-glance dd { font-size: 15px; }
  .xp-section { padding-top: 80px; }
  .xp-entry { grid-template-columns: minmax(0, 1fr); padding: 30px 0 36px; }
  .xp-when { padding: 0 0 10px; }
  .xp-when span { display: inline; }
  .xp-when span::before { content: " · "; }
  .xp-main h3 { font-size: 25px; }
  .xp-role { font-size: 16px; }
  .xp-points, .xp-summary { font-size: 16px; }
  .xp-facts { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  /* a swipeable row rather than a tall stack of tiles */
  .xp-projects {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 44%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin-right: calc(-1 * var(--case-edge));
    padding-right: var(--case-edge);
  }
  .xp-projects::-webkit-scrollbar { display: none; }
  .xp-proj { scroll-snap-align: start; }
  .xp-also-row { grid-template-columns: minmax(0, 1fr); padding: 8px 0; }
  .xp-also-row .xp-when { padding: 0; }
}

/* photographic tiles fill the frame; cut-outs stay contained on the tile */
.tile img.cover { object-fit: cover; padding: 0; }

/* three nav items on the narrowest phones */
@media (max-width: 380px) {
  .nav { gap: 28px; }
  .contact-copy-label { min-width: 0; }
}
