/* Depth layer (edition 08). Loads after report.css on every page.
   1. Survey lines: faint oxblood contour lines across the paper, like a survey map
      behind a report. Three tiles at different scales, in /assets/survey-*.svg.
   2. Plates: real photographs (warm natural-colour grade, see docs/PHOTOS.md) in
      squared frames with a report caption, filling the empty side of page openers.
   3. Case file: a stacked sheet with the published prices, pen circle and
      inspector's note, on the services opener.
   Only existing tokens, plus two paper tints for the sheets behind the case file. */

:root {
  --sheet-back-1: #f7f1ee;
  --sheet-back-2: #efe6e2;
  --off: 14px;
}

/* ---------- 1. Survey lines ---------- */

/* The lines sit on their own fixed layer that drifts slowly, like the
   contours behind the home hero. Transform only; still under reduced motion. */
body {
  background-color: var(--paper);
  background-image: none;
  isolation: isolate;
}
body::before {
  content: "";
  position: fixed;
  inset: -400px;
  z-index: -1;
  pointer-events: none;
  background-image:
    url("/assets/survey-1.svg"), url("/assets/survey-2.svg"),
    url("/assets/survey-3.svg");
  background-size:
    1200px 720px,
    1800px 1100px,
    2600px 1600px;
  background-position:
    0 0,
    420px 260px,
    120px 640px;
  background-repeat: repeat;
  will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: survey-drift 70s ease-in-out infinite alternate;
  }
}
@keyframes survey-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-360px, -160px, 0);
  }
}
body::after {
  opacity: 0.08;
}

/* Paper sections let the lines show through; tinted ones stay tinted. */
.page-opener,
.l-section,
main > section:not(.poster-hero):not(.process):not(.closing-band):not(.on-white) {
  background-color: transparent;
}
.page-home .fact-strip,
.page-home .questions,
.ld-sec.tint {
  background-color: rgba(242, 233, 230, 0.78);
}

/* Long reading text sits on clear paper: the lines fade out behind it. */
.article-content,
.qa,
.spec-list {
  background-color: var(--paper);
  box-shadow: 0 0 48px 40px var(--paper);
}
@media (max-width: 650px) {
  .article-content,
  .qa,
  .spec-list {
    box-shadow: 0 0 24px 16px var(--paper);
  }
}

/* ---------- 2. Plates ---------- */

.ld-grid.has-plate {
  align-items: center;
}
.plate {
  margin: 0;
  min-width: 0;
}
.plate-frame {
  position: relative;
  background: var(--sheet-face);
  border: 1px solid var(--main);
  padding: 8px;
  box-shadow: var(--lift);
}
.plate-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  background: var(--paper-deep);
}
.plate figcaption {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--main);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.plate figcaption b {
  font-weight: 700;
  color: var(--ink);
}
.plate-no {
  margin-right: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pen);
}

/* Home founder section: plate beside the statement. */
.founder-layout.has-plate {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
.founder-layout.has-plate .plate {
  order: -1;
}
@media (min-width: 901px) {
  .founder-layout.has-plate .founder-copy {
    display: block;
  }
  .founder-layout.has-plate .founder-copy > .founder-statement {
    margin: 0 0 24px;
  }
}

@media (max-width: 900px) {
  .founder-layout.has-plate {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .founder-layout.has-plate .plate {
    order: 0;
  }
  .ld-grid.has-plate {
    gap: 28px;
  }
  .plate-frame img {
    aspect-ratio: 16 / 10;
  }
}

/* ---------- 3. Case file (services opener) ---------- */

.case-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 88px);
  align-items: center;
}
.case-file {
  justify-self: end;
  width: 100%;
  max-width: 480px;
  margin: 0;
}
.case-stack {
  position: relative;
  margin: 0 calc(var(--off) * 2) calc(var(--off) * 2) 0;
}
.case-stack::before,
.case-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sheet-back-1);
  border-top: 3px solid var(--main);
  box-shadow: var(--lift);
  transform: translate(var(--off), var(--off));
}
.case-stack::after {
  z-index: -1;
  background: var(--sheet-back-2);
  transform: translate(calc(var(--off) * 2), calc(var(--off) * 2));
}
.case-sheet {
  position: relative;
  z-index: 1;
  background: var(--sheet-face);
  border-top: 3px solid var(--main);
  box-shadow: var(--lift);
}
.case-index {
  padding: 26px 28px 22px;
}
.case-file figcaption {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
}
.case-file .exhibit {
  display: inline-block;
  margin-right: 8px;
  padding: 3px 9px;
  font: 700 12px/1.3 var(--body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hand-note {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 4px;
  font: 600 25px/1.1 var(--hand);
  color: var(--pen);
}
.hand-note svg {
  order: -1;
  flex: none;
  width: 36px;
  height: 27px;
  margin-top: -2px;
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stamp {
  position: absolute;
  top: 22px;
  right: 24px;
  padding: 4px 9px 3px;
  border: 2px solid var(--pen);
  color: var(--pen);
  font: 700 12px/1.3 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.case-kicker {
  margin: 0 0 14px;
  font: 700 13px/1.4 var(--body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.case-rows {
  list-style: none;
  margin: 44px 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
}
.case-rows li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.ci-no {
  font: 600 14px/1 var(--body);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ci-name {
  font: 800 25px/1 var(--display);
  text-transform: uppercase;
  color: var(--main);
}
.ci-price {
  font: 700 16px/1.2 var(--body);
  color: var(--ink);
  text-align: right;
}
.ci-fig {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.pen-circle {
  position: absolute;
  left: -16px;
  top: -10px;
  width: calc(100% + 32px);
  height: calc(100% + 20px);
  max-width: none;
  overflow: visible;
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pen-circle path {
  vector-effect: non-scaling-stroke;
}
.case-foot {
  margin: 14px 0 0;
  font-size: 15px;
  color: var(--muted);
}

@media (max-width: 900px) {
  :root {
    --off: 9px;
  }
  .case-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }
  .case-file {
    justify-self: start;
    max-width: 440px;
  }
}
@media (max-width: 520px) {
  :root {
    --off: 7px;
  }
  .case-index {
    padding: 20px 18px 16px;
  }
  .stamp {
    top: 16px;
    right: 16px;
    font-size: 11px;
  }
  .case-rows {
    margin-top: 40px;
  }
  .case-rows li {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    padding: 12px 0;
  }
  .ci-name {
    font-size: 21px;
  }
  .ci-price {
    max-width: 8.5em;
    font-size: 15px;
  }
  .ci-fig {
    white-space: normal;
  }
  .hand-note {
    font-size: 23px;
  }
}

@media print {
  body::before {
    display: none;
  }
  .case-stack::before,
  .case-stack::after {
    display: none;
  }
  .plate-frame,
  .case-sheet {
    box-shadow: none;
  }
}

/* Legal pages read on clear paper. */
.page-legal .on-white {
  background-color: var(--paper);
}

/* ---------- Section dividers ---------- */
/* Replaces the full-width 2px oxblood rule: a short oxblood bar at the
   content edge running into a hairline that fades out, like a survey mark. */
main > section {
  border-bottom: 0;
}
main > section + section:not(.closing-band) {
  position: relative;
  border-top: 0;
}
main > section + section:not(.closing-band)::before {
  content: "";
  position: absolute;
  top: 0;
  left: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  height: 3px;
  pointer-events: none;
  background:
    linear-gradient(var(--main), var(--main)) left top / 56px 3px no-repeat,
    linear-gradient(90deg, rgba(91, 26, 34, 0.45), rgba(91, 26, 34, 0.12) 60%, rgba(91, 26, 34, 0))
      left 1px / 100% 1px no-repeat;
}
/* Tinted sections already read as a step; they need no divider line. */
main > section.tint::before,
main > section + section.tint + section::before {
  background:
    linear-gradient(var(--main), var(--main)) left top / 56px 3px no-repeat;
}
/* The home fact strip carries its own rules. */
main > .fact-strip::before,
main > .fact-strip + section::before {
  display: none;
}
