/* ==========================================================================
   7.MATTER — Sustainability page (/sustainability), 11 Nov 2026
   Four full-screen slides that stack over each other as the page scrolls
   (the same sticky pattern as the About page), text centred, fade-up reveal.
   Loaded only by sustainability.html, after the site CSS and /sidebar.css.
   ========================================================================== */

html.sus-page { scroll-snap-type: y proximity; }

.sus-stack { position: relative; }

/* snap points, one per slide (placed by sustainability.js) */
.sus-snap {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
  scroll-snap-align: start;
  pointer-events: none;
}

.sus-slide {
  --sus-top: 0px;
  position: sticky;
  top: var(--sus-top);
  min-height: calc(100svh - var(--sus-top));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px clamp(16px, 7vw, 101px);
  text-align: center;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  transition: background-color .26s ease, color .26s ease;
}
/* a subtle change of tone between slides, from the site's own surface colour */
.sus-slide:nth-of-type(even) { background: var(--surface); }
.sus-slide:nth-of-type(1) { z-index: 1; }
.sus-slide:nth-of-type(2) { z-index: 2; }
.sus-slide:nth-of-type(3) { z-index: 3; }
.sus-slide:nth-of-type(4) { z-index: 4; }

/* type: heading, secondary line, description */
.sus-slide h1,
.sus-slide h2 {
  margin: 0;
  max-width: 1100px;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.02;
  text-wrap: balance;
}
.sus-slide h1 { font-size: clamp(46px, 6.6vw, 112px); }
.sus-slide h2 { font-size: clamp(42px, 5.6vw, 96px); }

.sus-lede {
  margin: clamp(18px, 2.2vw, 28px) 0 0;
  max-width: 760px;
  font-family: var(--font-head);
  font-size: clamp(22px, 2.4vw, 36px);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.2;
  text-wrap: balance;
}
.sus-copy {
  margin: clamp(16px, 1.8vw, 24px) 0 0;
  max-width: 600px;
  color: var(--muted);
  font-size: clamp(17px, 1.35vw, 19px);
  line-height: 1.6;
  text-wrap: pretty;
}
.sus-principles {
  margin: clamp(22px, 2.6vw, 34px) 0 0;
  max-width: 600px;
  font-size: clamp(16px, 1.3vw, 18px);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .01em;
  text-wrap: balance;
}

/* desktop: slides sit under the pinned logo bar */
@media (min-width: 861px) {
  .sus-slide { --sus-top: var(--bar-h, 84px); }
}
/* phones and tablets: slides sit under the sticky top bar */
@media (max-width: 860px) {
  .sus-slide { --sus-top: 60px; padding-top: 56px; padding-bottom: 56px; }
}
/* phones and tablets with the swipe script: it moves one slide per swipe, so the browser's
   own snapping is switched off; each arriving slide casts a soft shadow onto the one it
   slides over (12 Nov) */
@media (max-width: 860px) {
  html.sus-page.sus-glide { scroll-snap-type: none; }
  .sus-slide + .sus-slide { box-shadow: 0 -16px 36px -12px rgba(20,20,20, .2); }
  html[data-theme=dark] .sus-slide + .sus-slide { box-shadow: 0 -18px 40px -10px rgba(0, 0, 0, .7); }
}

/* very short screens (phones turned sideways): plain scrolling, no stacking */
@media (max-height: 520px) {
  .sus-slide { position: relative; top: auto; min-height: 0; padding-top: 64px; padding-bottom: 64px; }
  html.sus-page { scroll-snap-type: none; }
}

/* reveal: text fades up as each slide arrives (only when the script runs) */
html.sus-js .sus-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease-out, transform .6s ease-out;
  transition-delay: calc(var(--i, 0) * 90ms);
}
html.sus-js .sus-slide.is-in .sus-reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.sus-page { scroll-snap-type: none; }
  html.sus-js .sus-reveal { opacity: 1; transform: none; transition: none; }
}

/* desktop: the wheel/trackpad script moves one slide per scroll, so CSS snapping is off (18 Nov) */
html.sus-page.sus-wheel { scroll-snap-type: none; }
