/* The site's two typefaces, served from the site itself (no call out to Google): DM Sans for text, Instrument Serif for headings */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/dm-sans.woff2) format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/instrument-serif.woff2) format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/instrument-serif-italic.woff2) format('woff2');
}

/* The registered mark after Home Angel. The serif draws ® as large as a capital letter, so wherever the serif is used
   that one character is taken from DM Sans, which draws it small and raised. Declared last, so it is the face tried first */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/dm-sans.woff2) format('woff2');
  unicode-range: U+00AE;
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/dm-sans.woff2) format('woff2');
  unicode-range: U+00AE;
}

/* ---------------------------------------------------------------
   Inspired Solutions
   Layout and colour sit inline on each element, as in the design.
   This file holds only what inline styles cannot: the base reset,
   the header breakpoint, hover / focus, and what changes with the width of the screen.
   --------------------------------------------------------------- */

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

/* An iPhone turned on its side enlarges some of the text and not the rest, unless it is told to leave the sizes as written */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', Arial, sans-serif;
  background: #fdfbf7;
  color: #2f2b36;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: inherit;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

/* Headings are evened out, so no line ends on one short word. The smallest headings (Your safety) and the questions
   in a list of questions and answers are headings too. */
h1,
h2,
h3,
h4,
dt {
  text-wrap: balance;
}

/* A heading written as two lines (a line break, then the italic part) is not evened out by the browser, which left one
   short word alone on a phone ("…next / door."). As a block of its own, the italic part is balanced like any heading. */
:is(h1, h2, h3) br + em {
  display: block;
}

/* Running text keeps a single short word off its last line; the answers under a question are running text as well */
p,
dd {
  text-wrap: pretty;
}

input,
textarea,
select,
button {
  font: inherit;
  color: inherit;
}

/* The typing cursor in the site's purple, like the selection and the focus ring */
input,
textarea {
  caret-color: #635792;
}

::selection {
  background: #635792;
  color: #fff;
}

:focus-visible {
  outline: 2px solid #635792;
  outline-offset: 3px;
  border-radius: 4px;
}

/* On a purple panel (the brand purple, or the darker purple that opens For councils) a purple ring cannot be seen,
   so there it is white. The links and buttons that stand on purple are the ones with these four hover looks. */
:is(.hv3, .hv14, .hv17, .hv25):focus-visible {
  outline-color: #fff;
}

/* The film and its large play button fill the film's frame, and the frame cuts off whatever is drawn outside it.
   Their ring is drawn just inside the frame, following its corners, in white on the dark picture. Once the film is playing
   without sound the button is the small "Turn the sound on" in the corner (the script marks it data-quiet): its ring
   goes round it as usual, in white. */
div:has(> #intro-film) > :focus-visible {
  outline-color: #fff;
}

div:has(> #intro-film) > :focus-visible:not([data-quiet]) {
  outline-offset: -8px;
  border-radius: 28px;
}

/* Moving through a page with the keyboard, backwards most of all, the browser brought the next link to the very top of the
   window, under the menu, where its ring could not be seen. Links, buttons and fields now keep clear of the menu's height
   when they are brought into view, and a little clear of the bottom. Section headings that links jump to are not touched. */
:where(main, body > footer) :where(a, button, summary, input, textarea, select) {
  scroll-margin-top: 96px;
  scroll-margin-bottom: 24px;
}

[hidden] {
  display: none !important;
}

/* Arrows nudge up and right on hover */
a svg:last-child,
button svg:last-child {
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}

a:hover svg:last-child,
button:hover svg:last-child {
  transform: translate(2px, -2px);
}

/* Ring around the film's play button */
@keyframes om-pulse {
  0% {
    transform: scale(1);
    opacity: .7;
  }

  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

/* Header: full navigation above 1260px (below that it no longer fits on one line), Menu button below */
@media (max-width: 1260px) {
  .nav-wide {
    display: none !important;
  }
}

@media (min-width: 1261px) {
  .nav-narrow {
    display: none !important;
  }
}

/* The menu is sized to fit beside the logo and the Let's talk button, which never gives up room for it */
nav.nav-wide {
  gap: 22px !important;
}

a.nav-wide {
  flex-shrink: 0;
}

@media (max-width: 1400px) {
  nav.nav-wide {
    gap: 14px !important;
  }
}

/* Home hero: once text and photo sit side by side (about 1100px wide) the whole opening screen fits the window,
   so type, spacing and the photo scale with the window's height as well as its width.
   The hero stops 85px short of the window, the height of the header. !important because these override the elements' inline styles. */
@media (min-width: 1100px) {
  /* Every other page: the opening section fills the first screen too, with its content centred in it. */
  main > section:first-child {
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  main > section:first-child > div[style*="max-width:1320px"] {
    width: 100%;
  }

  .hero-inner {
    min-height: calc(100vh - 100px);
    padding-block: clamp(20px, 4vh, 64px) !important;
  }

  .hero-title {
    font-size: clamp(48px, min(6.6vw, 11.5vh), 108px) !important;
  }

  .hero-text {
    max-width: 500px !important;
    font-size: clamp(16px, min(1.35vw, 2.6vh), 19px) !important;
  }

  /* The opening photo is a square with rounded corners, as on every other page, and never taller than the window leaves room for.
     Its size is set here as well as on the photo: the script's stand-in for it (which keeps its place while it grows) only has this class. */
  .hero-photo {
    aspect-ratio: 1 / 1;
    max-height: min(640px, calc(100vh - 100px - 2 * clamp(20px, 4vh, 64px))) !important;
  }
}

/* Home hero text: one measured gap between the paragraphs, and that gap plus extra air under the headline.
   A line of text carries empty space above its capitals and below its baseline; the em values
   take that off, so the gaps are measured from the letters you see, not the boxes around them. */
.hero-copy {
  gap: clamp(18px, 3vh, 30px);
}

.hero-title {
  margin: 0 0 clamp(12px, 2.4vh, 24px) !important;
}

.hero-text {
  margin: -.44em 0 -.46em !important;
  line-height: 1.6 !important;
}

/* ---------------------------------------------------------------
   Hover and focus states
   !important because they override the element's inline style.
   --------------------------------------------------------------- */

.hv1:hover {
  color: #635792 !important;
}

.hv2:hover {
  background: #4c426f !important;
  color: #fff !important;
}

.hv3:hover {
  background: #f2eff7 !important;
  color: #635792 !important;
}

.hv4:hover {
  background: #fff !important;
}

.hv5:hover {
  border-color: #c5bcd6 !important;
}

.hv6:hover {
  transform: scale(1.08) !important;
}

.hv7:hover {
  transform: translateY(-4px) !important;
  border-color: #635792 !important;
}

.hv8:hover {
  color: #4c426f !important;
  border-color: #635792 !important;
}

.hv9:hover {
  color: #fff !important;
  transform: translateY(-6px) !important;
  box-shadow: 0 50px 90px -40px rgba(58,42,92,.5) !important;
}

.hv10:hover {
  color: #3f5446 !important;
  border-color: #56705d !important;
}

.hv11:hover {
  transform: translateY(-4px) !important;
  border-color: #635792 !important;
}

.hv12:hover {
  background: #fff !important;
  transform: translateY(-3px) !important;
}

.hv13:hover {
  color: #4c426f !important;
}

.hv14:hover {
  color: #fff !important;
  border-color: #fff !important;
}

.hv15:hover {
  transform: translateY(-5px) !important;
}

.hv16:hover {
  color: #fff !important;
  transform: translateY(-8px) !important;
  box-shadow: 0 50px 90px -40px rgba(47,43,54,.5) !important;
}

.hv17:hover {
  color: #fff !important;
}

.hv18:hover {
  background: #fff !important;
  color: #635792 !important;
}

.hv19:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 40px 70px -40px rgba(58,42,92,.4) !important;
}

.hv20:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 40px 70px -40px rgba(47,43,54,.6) !important;
}

.hv21:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 40px 70px -40px rgba(138,106,69,.35) !important;
}

.hv22:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 40px 70px -40px rgba(60,80,60,.4) !important;
}

.hv23:hover {
  color: #3f5446 !important;
}

.hv24:hover {
  transform: translateY(-5px) !important;
}

.hv25:hover {
  background: rgba(255,255,255,.1) !important;
  color: #fff !important;
}

.hv26:hover {
  background: #4c426f !important;
}

.fc1:focus {
  top: 14px !important;
}

.fc2:focus {
  border-color: #635792 !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(99,87,146,.3) !important;
}

/* Home support links change colour without reflowing their text. */

.help-row .help-go {
  transition: background .35s, border-color .35s, color .35s;
}

.help-row:hover h3 {
  color: #635792;
}

.help-row:hover .help-go {
  background: #635792;
  border-color: #635792 !important;
  color: #fff !important;
}

/* ---------------------------------------------------------------
   Layout borrowed from the best of Refero Styles:
   a floating capsule menu (Bevel, General Intelligence Company), coloured sections as rounded
   panels set in from the page edge (Wise, Bevel), and hairlines instead of drop shadows
   (ElevenLabs, Ramp). !important because these override the elements' inline styles.
   --------------------------------------------------------------- */
.site-header {
  top: 10px !important;
  width: min(1360px, calc(100% - 2 * var(--edge)));
  margin: 10px auto 0;
  border: 1px solid #e6e0da !important;
  border-radius: 36px;
  background: rgba(253, 251, 247, .97) !important; /* nearly solid: page text passing behind must not read through the menu */
  box-shadow: 0 1px 2px rgba(58, 42, 92, .05), 0 8px 24px -16px rgba(58, 42, 92, .18) !important;
}

.site-header .header-inner {
  height: 68px !important;
  padding: 0 10px 0 clamp(16px, 2vw, 26px) !important;
}

.site-header .header-progress {
  display: none;
}

/* The narrowest screens (320px: an iPhone set to larger text, or a page zoomed in Safari): the logo and the Menu button did not
   both fit, so the button poked out of the header and the page slid sideways. There the gap closes up and the logo gives way
   by the few pixels needed. Only this narrow: on a wide screen the logo must never shrink to make room for the full menu.
   !important because the gap and the logo's fixed width are inline. */
@media (max-width: 345px) {
  .site-header .header-inner {
    gap: 12px !important;
  }

  .site-header .header-inner > a:first-of-type {
    flex-shrink: 1 !important;
    min-width: 0;
  }
}

/* The open menu: the last item has nothing below it to be divided from, so its line is not drawn
   (it keeps its place, so the row keeps its height). !important because the line is inline. */
#mobile-nav a:last-child {
  border-bottom-color: transparent !important;
}

/* On a short screen (a phone on its side) the open menu is taller than the window, and the header stays put while the page scrolls,
   so the lower items could never be reached. The menu stops 6px above the bottom of the window and scrolls inside itself.
   Where the screen is short but wide it also sets its links in two columns, so all of them show at once and nobody has to
   guess that there is more to scroll to. In two columns the last row is two links, and neither has a line under it. */
#mobile-nav {
  max-height: calc(100vh - 85px);
  max-height: calc(100dvh - 85px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-height: 520px) and (min-width: 560px) {
  #mobile-nav {
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
  }

  #mobile-nav a:nth-last-child(2):nth-child(odd) {
    border-bottom-color: transparent !important;
  }
}

:root {
  --edge: clamp(8px, 1.1vw, 18px);
}

/* Each selector is written twice: once the script touches an element, the browser rewrites its style with spaces and rgb() colours */
main > :is(section, div)[style*="background"]:not([style*="background:#fdfbf7"]):not([style*="background: rgb(253, 251, 247)"]):not([aria-hidden]),
#growth-and-scalability > section {
  margin: var(--edge) var(--edge) 0;
  border-radius: clamp(22px, 2.6vw, 40px);
  overflow: clip;
}

/* Its panel's top margin stays inside it, where its page colour covers the section held behind (it showed through as a sliver) */
#growth-and-scalability {
  display: flow-root;
}

/* The purple "where to go next" panel and the footer make one closing panel */
.closing {
  margin: var(--edge) var(--edge) 0;
  border-radius: clamp(22px, 2.6vw, 40px) clamp(22px, 2.6vw, 40px) 0 0;
}

/* Its sentence is set like a heading, so its lines are evened out like one */
.closing p {
  text-wrap: balance;
}

body > footer {
  margin: 0 var(--edge) var(--edge);
  border-radius: 0 0 clamp(22px, 2.6vw, 40px) clamp(22px, 2.6vw, 40px);
}

/* Without a closing sentence, the footer is a panel of its own, rounded all the way round.
   Let's talk is one lavender area from top to bottom: it is set in from the page edge like every other coloured panel. */
main:not(:has(> .closing)) + footer {
  margin-top: var(--edge);
  border-radius: clamp(22px, 2.6vw, 40px);
}

body[data-page="contact"] main {
  margin: var(--edge) var(--edge) 0;
  border-radius: clamp(22px, 2.6vw, 40px);
}

/* Home: the ribbon of photos drifts left for ever; it is doubled in the page so the loop has no seam */
.ribbon-track {
  animation: ribbon 70s linear infinite;
}

.ribbon:hover .ribbon-track {
  animation-play-state: paused;
}

@keyframes ribbon {
  to {
    transform: translateX(-50%);
  }
}

/* With reduced motion nothing drifts, pulses or glides: the ribbon stands still, the ring round the film's play button
   does not pulse (!important because its animation is inline) and a jump down the page is a jump, not a glide. */
@media (prefers-reduced-motion: reduce) {
  .ribbon-track {
    animation: none;
  }

  [data-play-film] [aria-hidden="true"] {
    animation: none !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Moving between pages: the old page lifts away and the new one rises in (browsers without this simply load the page).
   The switch that turns it on, @view-transition, is written into each page's head, with its off switch for reduced motion:
   read from this file it arrived too late on the live site, and the browser skipped the move. */
::view-transition-old(root) {
  animation: page-out .3s ease both;
}

::view-transition-new(root) {
  animation: page-in .65s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes page-out {
  to {
    opacity: 0;
    transform: translateY(-14px);
  }
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}

.site-header {
  view-transition-name: site-header;
}

/* The round "View" button that follows the pointer over photo links */
.view-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #635792;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  transform: scale(0);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}

/* Pinned headings belong beside their text. In one column they would stay put and slide over it, so below 1000px they scroll normally.
   (The two that are left, on the home page and Your community, sit beside their lists from about 980px up.)
   Both spellings again: the browser rewrites an inline style once the script has touched it. */
@media (max-width: 999px) {
  [style*="position:sticky"][style*="align-self:start"],
  [style*="position: sticky"][style*="align-self: start"] {
    position: static !important;
  }
}

/* Story rows: a photo on one side, its heading and words on the other, level with each other, swapping sides from row to row.
   Below 900px the words come first and the photo follows them, on every page alike (it had been photo first on For councils
   and About us, words first on the "Your ..." pages). A row without a photo has its heading on the left and its words on the right. */
.story {
  display: grid;
  gap: 28px clamp(40px, 6vw, 96px);
  align-items: center;
  padding: clamp(40px, 5vw, 64px) 0;
}

@media (min-width: 900px) {
  .story {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  }

  .story:nth-of-type(even) > .story-photo {
    order: -1;
  }

  .story:nth-of-type(even) {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }
}

/* Your safety, the leak film: its steps run in a row under the film on a wide screen, each with its number on top,
   and one under another on a narrower one. !important because the steps' own layout is inline. */
.film-steps {
  display: grid;
}

@media (min-width: 1200px) {
  .film-steps {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    column-gap: 24px;
    border-bottom: 0 !important;
  }

  .film-steps > li {
    flex-direction: column;
    gap: 14px !important;
    padding: 20px 0 0 !important;
  }
}

/* Four of a kind (a grid of exactly four, such as four points under "what you can expect") sit four in a row or two by two,
   never three with the fourth alone underneath, as they did on an iPad. Their grids are the two with 250px columns.
   The eight principles on About us (the list that ends in the white card) do the same: two or four across, never three,
   which left an empty place beside the white card. Up to 1226px, so a desktop window with a scrollbar is covered too.
   Both spellings again; !important because the columns are inline. */
@media (min-width: 600px) and (max-width: 1226px) {
  main div:is([style*="minmax(min(100%,250px),1fr)"], [style*="minmax(min(100%, 250px), 1fr)"]):has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 906px) and (max-width: 1226px) {
  main ul:has(> li.white) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* The footer's last row keeps clear of the guide's button in the corner, and "back to top" is a full thumb's width.
   !important because the button's size is inline. Everything in the row sits on one line: the year and the company number
   are level with "Let's talk" and the arrow, where they used to hang 12px higher. */
footer > div > div:last-child {
  padding-right: 84px;
  align-items: center;
}

/* On a phone that row is three tidy lines: the year, the company number, then the small links with "Let's talk" and
   "back to top" at the end. (It was two until the Privacy link joined the row: with it the arrow dropped to a line of its own.)
   Up to 640px: between 601 and about 640px they did not all fit on one line either. */
@media (max-width: 640px) {
  footer > div > div:last-child {
    column-gap: 12px !important;
    align-items: center;
    padding-right: 64px;
  }

  footer > div > div:last-child > span {
    flex-basis: 100%;
  }
}

/* Between 360 and 373px the back-to-top button fell alone onto a third row: a narrower gap keeps it beside "Let's talk",
   and still clear of the guide's button */
@media (max-width: 373px) {
  footer > div > div:last-child {
    column-gap: 8px !important;
    padding-right: 56px;
  }
}

.to-top {
  width: 44px !important;
  height: 44px !important;
}

/* Contact: the opening is only as tall as its words, so the three answers below it are on the first screen.
   It also goes without the opening panel's lighting, which would end in a visible edge above them.
   The plain text pages (privacy, accessibility, complaints) open the same way, so their words start on the first screen. */
body[data-page="contact"] main > section:first-child,
body[data-page="text"] main > section:first-child {
  min-height: 0;
  display: block;
  background-image: none !important;
}

/* Touch screens: footer links get a target at least 44px tall for a thumb, and so does the small "Inspired Solutions"
   link above each page's heading (its extra height is taken back off the line, so nothing moves).
   Both spellings again: the browser rewrites a style once the script has touched the element. */
@media (pointer: coarse) {
  footer a {
    display: inline-block;
    padding-block: 12px;
  }

  /* The full menu on a large iPad on its side: each link is 37px tall, so an unseen area around it takes the thumb.
     Nothing moves, and the areas of two neighbours stop 2px short of each other. */
  nav.nav-wide a::after {
    content: "";
    position: absolute;
    inset: -5px -6px;
  }

  main p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"]) > a {
    display: inline-block;
    padding-block: 12px;
    margin-block: -12px;
  }
}

/* That extra height sets the logo and the links 12px lower than the address beside them, where the footer's three columns stand
   side by side (from 958px). There the address comes down by the same 12px, so all three start on one line, as with a mouse.
   Stacked on a phone or an upright iPad the gaps are even as they are, so nothing changes there. */
@media (pointer: coarse) and (min-width: 958px) {
  footer address {
    padding-top: 12px;
  }
}

/* Depth. The opening panel of every page is lit softly from the top right, with a breath of purple in the far corner,
   and the film sits on the page like a screen with a shadow under it. !important because the panels' colours are inline. */
main > section:first-child:not([style*="gradient"]):not(.council-hero):not(.resident-hero) {
  background-image: radial-gradient(70% 90% at 88% 8%, rgba(255, 255, 255, .75), transparent 62%), radial-gradient(55% 65% at 0% 100%, rgba(99, 87, 146, .08), transparent 62%) !important;
}

div:has(> #intro-film) {
  box-shadow: 0 1px 2px rgba(58, 42, 92, .08), 0 60px 90px -50px rgba(58, 42, 92, .55);
}

/* A slim scrollbar in the site's own purple */
html {
  scrollbar-width: thin;
  scrollbar-color: #b9afd6 transparent;
}

/* Two details borrowed from Refero's editorial styles. A short rule leads each small-capitals label, as in a journal
   (General Intelligence Company, OpenAI), and every photo rests on a soft, warm shadow instead of sitting flat (Bevel).
   Each selector is written in both spellings: the browser rewrites a style once the script has touched the element. */
main p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"])::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  margin-right: 12px;
  vertical-align: middle;
  background: currentColor;
  opacity: .5;
  transform: translateY(-1px);
}

main div:is([style*="overflow:hidden"], [style*="overflow: hidden"]):has(> img, > video, > [data-parallax]):not(.ribbon *) {
  box-shadow: 0 44px 70px -52px rgba(58, 42, 92, .5);
}

/* The "Inspired Solutions / page name" label lays its parts out in a row with a 10px gap, which came on top of the rule's 12px
   and left the rule 22px from the words. Here the rule brings 2px, so with the gap it stands 12px away like every other one. */
main p:is([style*="display:flex"], [style*="display: flex"]):is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"])::before {
  margin-right: 2px;
}

/* A label too long for one line ("What you and your neighbours can expect" on a phone) starts its second line under its
   first word, not under the rule: the label is set in by the rule and its gap (34px) and the rule is pulled back out into
   that space. A label on one line does not move. Not the page-name label, which is laid out as a row. */
main p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"]):not([style*="display:flex"], [style*="display: flex"]) {
  padding-left: 34px;
}

main p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"]):not([style*="display:flex"], [style*="display: flex"])::before {
  margin-left: -34px;
}

/* On the narrowest phones (under 390px) the rule is shorter, which keeps "The things that make a difference" and
   "Our hope for every place we build" on one line. Every label gets the same shorter rule, so they stay alike. */
@media (max-width: 389px) {
  main p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"])::before {
    width: 14px;
    margin-right: 8px;
  }

  main p:is([style*="display:flex"], [style*="display: flex"]):is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"])::before {
    margin-right: -2px;
  }

  main p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"]):not([style*="display:flex"], [style*="display: flex"]) {
    padding-left: 22px;
  }

  main p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"]):not([style*="display:flex"], [style*="display: flex"])::before {
    margin-left: -22px;
  }
}

/* The opening section of each page.
   Its photo is a square that is never taller than a set height. In one column on anything wider than a phone that height
   made the square narrower than its column too, so it stood on the left with up to 44% of the panel empty beside it.
   Given a width of its own, the photo keeps that height and runs the full width of the column, as the photo on Your home does.
   Beside the words (from 1051px) and on a phone the column is narrower than the height allows, so there it is the square it was.
   Only below 1100px: from there the home page's photo is also held to the height of the window, and has to stay a square. */
@media (max-width: 1099px) {
  main > :first-child [data-intro-arch] {
    width: 100%;
  }
}

/* Your energy: in that wide frame the whole width of the photo shows, and with it the corner of a roof at its left edge,
   which the square frame crops away. Drawn 15% wider, the corner is out of the frame again, also when the photo drifts as the page scrolls. */
@media (min-width: 600px) and (max-width: 1099px) {
  main > :first-child [data-parallax]:has(> img[src*="photo-solar-roofs"]) {
    left: -15% !important;
  }
}

/* The page's name above each headline ("Inspired Solutions / Your community") stays on one line on a phone.
   With its lead-in rule the longest needs about 350px and an iPhone has 319 to 358, so on some pages it broke in two after the slash
   and on others it did not. Below 430px it goes without the rule, and with smaller gaps, on every page alike; where even that
   does not fit (a 320px screen) the second line now starts under the first. Every other label keeps its rule.
   !important because the gap is inline. */
@media (max-width: 429px) {
  main p[data-intro="0"]:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"])::before {
    display: none;
  }

  main p[data-intro="0"]:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"]) {
    column-gap: 6px !important;
  }
}

/* Home headline: its three lines are set by hand, and at 58px the longest needs 300px. A screen narrower than 360px
   (an iPhone set to larger text is 320px) has less, so every line broke in two and the headline took six.
   There its size follows the width of the screen, less the 56px either side of it, and the three lines fit again.
   !important because the size is inline. */
@media (max-width: 359px) {
  .hero-title {
    font-size: calc((100vw - 56px) * .19) !important;
  }
}

/* For councils: the purple wash over the opening photo thins out to the right, where on a wide screen there are no words.
   On a phone the words run the full width, and the end of the small label ("For councils") lay on pale brick, too faint to read.
   Up to 600px a second wash runs across the top of the panel, behind the label, and fades out before it reaches the man's face;
   the rest of the photo is as bright as it was. Its depth is in pixels because the label sits 56 to 77px down the panel on a phone:
   if the panel's top padding changes, this follows. !important because the wash is inline. */
@media (max-width: 600px) {
  main > section:first-child > span[style*="linear-gradient(90deg"] {
    background: linear-gradient(180deg, rgba(76, 66, 111, .58) 0, rgba(76, 66, 111, .58) 84px, rgba(76, 66, 111, 0) 128px), linear-gradient(90deg, rgba(76, 66, 111, .96) 0%, rgba(76, 66, 111, .84) 45%, rgba(76, 66, 111, .3) 100%) !important;
  }
}

/* For councils: on two lines the headline's first line ran across the face of the man in the photo ("families" over his eyes),
   from a small tablet up to a window of about 1467px. Held to 5.6 times its own size it sets on three lines, as it already does
   on a phone and on a wide screen, and stays clear of him. Not in a window wider than 1199px and under 840px tall (a laptop):
   there the third line would push the two buttons off the first screen, so the headline keeps its two lines.
   !important because the width is inline; both spellings because the script rewrites the heading's style. */
@media (max-width: 1199px), (min-height: 840px) {
  main > section:first-child h1:is([style*="max-width:900px"], [style*="max-width: 900px"]) {
    max-width: 5.6em !important;
  }
}

/* Page not found is one panel and nothing else: three lines of words. On an upright iPad the whole page was shorter than the
   screen, so a band of bare page showed under the footer, and the guide's button sat on top of "back to top".
   From 601px the panel fills the first screen with its words centred, as it already does from 1100px; on a phone the page
   is taller than the screen as it is. It is the only page whose main part is a single section, which is how it is picked out. */
@media (min-width: 601px) {
  main > section:only-child {
    min-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  main > section:only-child > div {
    width: 100%;
  }
}

/* Home page, the street photo in "A different way forward": on a phone narrower than 430px the cream note over the photo had too little
   room for its two lines beside the arrow, so "Thoughtfully designed. Built for family life." ran to three lines, and four on the
   smallest iPhone. There the note sits a little closer to the photo's edges with less padding, and its words are 23px, which keeps
   them on the two lines they are written in. !important because the note's place, padding and size are inline. */
@media (max-width: 429px) {
  .index-photo-note {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    gap: 12px !important;
    padding: 20px 18px !important;
  }

  .index-photo-note p {
    font-size: 23px !important;
  }
}

/* Your community, "Spaces that bring neighbours together": the garden photo is upright and its frame is 4:3, so only the middle
   of it shows, and that cut the grandfather off at the forehead. Moved up a little, his whole head is in the frame and the basil
   they are planting is still along the bottom. The rule goes by the photo's name so it also holds its slow-motion clip, which is
   framed the same way, and lets go by itself if another photo is put in that row. */
.story-photo :is(img, video)[src*="photo-garden-portrait"] {
  object-position: 50% 38%;
}

/* Your safety, the three short films under "It notices more than leaks": three in a row or one under another, never two
   with the third alone beneath them, as they stood on an upright iPad and on a phone turned on its side.
   Up to 947px they are one under another. !important because the columns are inline. */
@media (max-width: 947px) {
  .your-safety-films {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* From 800px a card that runs the full width lies on its side: the film on the left, its words beside it. Only from 800px,
   because from there the words are never taller than the film, so no strip of the card shows above or below it.
   Narrower than that the film stays on top of its words, as on a phone. */
@media (min-width: 800px) and (max-width: 947px) {
  .your-safety-films > section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }
}

/* From 948px the three stand in a row, each at least 265px wide (the columns written in the page wanted 300px each,
   which three only had from 1050px, so an upright 13-inch iPad showed two and one). */
@media (min-width: 948px) {
  .your-safety-films {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Drawn explainers (Your energy, Your safety; their frame is components/DrawnExplainer.astro): a drawing that builds up, each part at its own moment
   (--at, written on the part, in seconds). These rules only apply once the script has armed it (.flow-armed): without the
   script, or with reduced motion, every part is simply there, finished. While armed, every movement waits on --flow-play:
   the script sets it running while the drawing is on screen, and the drawing's own button pauses it. */
.flow-dots,
.flow-ring {
  opacity: 0;
}

[data-flow-button]:hover {
  background: var(--flow-hover) !important;
}

/* Words first, then the drawing, then its steps. From 1000px the drawing stands beside the words, its steps under the heading */
.flow {
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}

@media (min-width: 1000px) {
  .flow {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    column-gap: clamp(40px, 6vw, 96px);
    align-content: center;
  }

  .flow-card {
    grid-area: 1 / 2 / span 2;
    align-self: center;
  }

  /* The heading and the steps meet in the middle of the drawing's height */
  .flow > :first-child {
    align-self: end;
  }

  .flow-steps {
    align-self: start;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .flow-armed :is(.flow-in, .flow-draw, .flow-lit, .flow-turn, .flow-drift, .flow-arrive, .flow-alert, .flow-ring, .flow-name, .flow-bar) {
    animation: var(--for, .8s) cubic-bezier(.2, .7, .2, 1) var(--at, 0s) both;
    animation-play-state: var(--flow-play, paused);
  }

  .flow-armed .flow-in {
    animation-name: flow-in;
  }

  /* A line is drawn from its start to its end: one dash as long as the line (the page gives each a length of 1) slides on */
  .flow-armed .flow-draw {
    stroke-dasharray: 1 3;
    animation-name: flow-draw;
  }

  .flow-armed .flow-lit {
    animation-name: flow-lit;
  }

  .flow-armed .flow-name {
    animation-name: flow-name;
  }

  .flow-armed :is(.flow-turn, .flow-bar) {
    animation-timing-function: linear;
    animation-iteration-count: var(--times, 1);
  }

  .flow-armed .flow-turn {
    animation-name: flow-turn;
  }

  .flow-armed .flow-bar {
    animation-name: flow-bar;
  }

  .flow-armed .flow-drift {
    animation-name: flow-drift;
    animation-timing-function: linear;
  }

  .flow-armed .flow-arrive {
    animation-name: flow-arrive;
  }

  /* Something is not right here: its ring turns amber for a while (--for), then goes back to its own colour */
  .flow-armed .flow-alert {
    animation-name: flow-alert;
    animation-timing-function: linear;
  }

  /* A ring spreads out from it and fades, --times times. Out of sight before and after, so it does not take the first frame early */
  .flow-armed .flow-ring {
    animation-name: flow-ring;
    animation-fill-mode: forwards;
    animation-iteration-count: var(--times, 1);
    transform-box: fill-box;
    transform-origin: center;
  }

  /* Dots travel along each of the energy's lines once it is drawn (--times round trips of .7s), and fade out at the end */
  .flow-armed .flow-dots {
    animation: flow-run .7s linear var(--at) var(--times) both, flow-show calc(var(--times) * .7s) linear var(--at) both;
    animation-play-state: var(--flow-play, paused);
  }
}

@keyframes flow-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes flow-draw {
  from {
    stroke-dashoffset: 1.01;
  }
}

@keyframes flow-lit {
  from {
    fill: var(--unlit, #e5eadf);
  }
}

@keyframes flow-arrive {
  from {
    opacity: 0;
    transform: translateX(-44px);
  }
}

@keyframes flow-alert {
  6%,
  92% {
    stroke: #d9a441;
    fill: #fbf1d8;
  }
}

@keyframes flow-ring {
  from {
    opacity: .8;
    transform: scale(.7);
  }

  to {
    opacity: 0;
    transform: scale(1.9);
  }
}

@keyframes flow-name {
  from {
    border-color: var(--flow-hair);
    background: transparent;
    color: #5e5967;
  }
}

@keyframes flow-turn {
  to {
    transform: rotate(var(--turn, 1turn));
  }
}

@keyframes flow-drift {
  to {
    transform: translateX(40px);
  }
}

@keyframes flow-bar {
  from {
    transform: scaleX(0);
  }
}

@keyframes flow-run {
  to {
    stroke-dashoffset: -22.1;
  }
}

@keyframes flow-show {
  8%,
  90% {
    opacity: 1;
  }
}

/* Home, "How can we help?", on a phone: the icon and the round arrow each took a column, which left the words a strip
   200px wide between them. There the icon stands beside the question and the words run the full width underneath.
   The round arrow goes: the whole row is the link, and its last line already names where it leads.
   !important because the row's columns and the icon's size are inline. */
@media (max-width: 599px) {
  .help-row {
    grid-template-columns: auto 1fr !important;
    gap: 0 14px !important;
  }

  .help-row > div {
    display: contents;
  }

  .help-row > span:first-child {
    width: 44px !important;
    height: 44px !important;
  }

  .help-row p,
  .help-row > div > span {
    grid-column: 1 / -1;
  }

  .help-row p {
    margin-top: 14px !important;
  }

  .help-row .help-go {
    display: none !important;
  }
}

/* The opening of the home page and of the five "Your ..." pages on a tablet (their columns are the ones written with 440px).
   Upright (600 to 899px) the words and the photo are one under the other, and the headline kept the size it has on a phone
   in a panel twice as wide, with half of it empty: there it grows with the screen, and the lines under it may run a little longer.
   On its side, or a large iPad upright (900 to 1050px), the words and the square photo stand side by side as on a desktop,
   so the whole opening is on the first screen; they used to do so only from 1051px.
   Both spellings again: the browser rewrites a style once the script has touched the element. !important because these are inline. */
@media (min-width: 600px) and (max-width: 899px) {
  main > :first-child :is([style*="minmax(min(100%,440px),1fr)"], [style*="minmax(min(100%, 440px), 1fr)"]) h1 {
    font-size: clamp(60px, 10vw, 88px) !important;
  }

  main > :first-child :is([style*="minmax(min(100%,440px),1fr)"], [style*="minmax(min(100%, 440px), 1fr)"]) h1 ~ p {
    max-width: 560px !important;
  }
}

@media (min-width: 900px) and (max-width: 1050px) {
  main > :first-child :is([style*="minmax(min(100%,440px),1fr)"], [style*="minmax(min(100%, 440px), 1fr)"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Home, "Our purpose": between 600 and 899px its photo and words are one under the other, and the upright photo, held to 520px,
   stood on the left with an empty strip beside it. There it runs the full width, as every other photo does on a tablet,
   in a wider frame that keeps the family's faces. !important because the frame's width and shape are inline. */
@media (min-width: 600px) and (max-width: 899px) {
  .purpose-photo {
    max-width: none !important;
  }

  .purpose-photo > div {
    aspect-ratio: 3 / 2 !important;
  }

  .purpose-photo img {
    object-position: 50% 6%;
  }
}

/* Three of a kind stand three in a row or one under another, never two with the third alone beneath them, as they did on an
   upright iPad. The three pages under "Continue exploring" (their grid is the one with 280px columns) are three in a row
   from 600px: their names are set smaller to fit, and the round arrow waits for a wider screen (the whole card is the link).
   The three promises on Your wellbeing (250px columns) are one under another up to 719px and three in a row from there.
   Both spellings again; !important because the columns and the sizes are inline. */
@media (min-width: 600px) and (max-width: 957px) {
  nav > div:is([style*="minmax(min(100%,280px),1fr)"], [style*="minmax(min(100%, 280px), 1fr)"]):has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  nav > div:is([style*="minmax(min(100%,280px),1fr)"], [style*="minmax(min(100%, 280px), 1fr)"]):has(> :nth-child(3):last-child) > a > span > span:first-child {
    font-size: clamp(20px, 3.2vw, 30px) !important;
  }

  nav > div:is([style*="minmax(min(100%,280px),1fr)"], [style*="minmax(min(100%, 280px), 1fr)"]):has(> :nth-child(3):last-child) > a > span > span:last-child {
    display: none !important;
  }
}

@media (min-width: 590px) and (max-width: 719px) {
  main div:is([style*="minmax(min(100%,250px),1fr)"], [style*="minmax(min(100%, 250px), 1fr)"]):has(> :nth-child(3):last-child) {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (min-width: 720px) and (max-width: 898px) {
  main div:is([style*="minmax(min(100%,250px),1fr)"], [style*="minmax(min(100%, 250px), 1fr)"]):has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* Plain sections (page colour, no panel) are set in from the page edge by the same amount as
   the coloured panels, so the words keep one left edge down the page. Below about 1350px they started 8 to 18px further left
   than the words inside a panel. Not Let's talk, where the whole page is one panel, and not the ribbon, which runs edge to edge. */
body:not([data-page="contact"]) main > section {
  margin-inline: var(--edge);
}

/* Keep capped-width exploration rows centred, with the same edge inset on smaller screens. */
main > nav { width:calc(100% - 2 * var(--edge)); }

/* Photo rows in one column (below 900px): the words ran the full width of a tablet, 85 letters to a line. Held to 36 times
   their own size they stay near 70. Beside a photo the column is narrower than that anyway. */
.story p {
  max-width: 36em;
}

/* Your energy, the three points: label, heading and words each start level across the three, whatever the length of a heading
   ("Always looking ahead." is one line, the other two are two, so its words started 48px higher). Each point takes its three
   rows from the row of three; a browser without that keeps them as they were. */
@supports (grid-template-rows: subgrid) {
  .pillars > article {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 3;
    row-gap: 0;
  }

}

/* Let's talk: while a message is on its way the button says so and is dimmed; a message that was sent can be read, not changed */
form.enquiry button[aria-disabled="true"] {
  opacity: .6;
  cursor: progress;
}

form.enquiry :is(input, textarea)[readonly] {
  color: #5e5967;
  border-color: transparent !important;
  resize: none !important;
}

/* With reduced motion the script draws nothing, and the line under "call your home." stayed undrawn but for a dot at its start
   (the round end of a line of no length). There it is simply drawn. !important because its starting state is inline. */
@media (prefers-reduced-motion: reduce) {
  [data-intro-stroke] path {
    stroke-dashoffset: 0 !important;
  }
}

/* "Continue exploring" on a phone: three full cards, each a large photo, took three screens of scrolling to offer three links,
   with photos the visitor has already seen. There each is a row: a small square of its photo, the page's name, the arrow.
   !important because the cards' layout and sizes are inline. */
@media (max-width: 599px) {
  nav > div:is([style*="minmax(min(100%,280px),1fr)"], [style*="minmax(min(100%, 280px), 1fr)"]) {
    gap: 12px !important;
  }

  nav > div:is([style*="minmax(min(100%,280px),1fr)"], [style*="minmax(min(100%, 280px), 1fr)"]) > a {
    flex-direction: row !important;
    align-items: center;
    border-radius: 28px !important;
  }

  nav > div:is([style*="minmax(min(100%,280px),1fr)"], [style*="minmax(min(100%, 280px), 1fr)"]) > a > div {
    flex: 0 0 104px;
    aspect-ratio: 1 / 1 !important;
    border-radius: 19px !important;
    box-shadow: none !important;
  }

  nav > div:is([style*="minmax(min(100%,280px),1fr)"], [style*="minmax(min(100%, 280px), 1fr)"]) > a > span {
    flex: 1;
    padding: 0 6px 0 18px !important;
  }
}

/* Your safety, the leak film's steps and the three short films: their words ran the full width of a tablet, up to 120 letters
   to a line. Held to 36 times their own size, like the words in a photo row. */
.film-steps p,
.your-safety-films p {
  max-width: 36em;
}

/* "Read the film's words" answers the pointer like every other link */
summary:hover {
  color: #4c426f !important;
}

/* With reduced motion a card under the pointer changes at once: it no longer glides up or leans in.
   !important because the cards' transitions are inline. */
@media (prefers-reduced-motion: reduce) {
  :is([class*="hv"], .help-row, .help-row *, .to-top, .menu-button) {
    transition: none !important;
  }
}

/* A section whose small label is left empty in the CMS has no label: no rule, no gap, and its heading starts where the label
   would have. (The labels that only said their heading over again were emptied on 10 October.) A card whose label sat in a row
   of its own loses that row. Both spellings again; !important because the heading's gap is inline. */
main p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"]):empty,
main div:has(> p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"]):empty:only-child) {
  display: none;
}

main p:is([style*="text-transform:uppercase"], [style*="text-transform: uppercase"]):empty + :is(h1, h2, h3) {
  margin-top: 0 !important;
}

/* Pause motion (made by js/site.js on a page with moving photos, short films or the ribbon). On a wide screen it sits in the
   corner across from the guide: a pill with its words at the top of the page, its sign alone once the page is scrolled, out of
   the way of the footer's small print. Paused, the ribbon stands still; the script stops the clips and the films. */
.motion-toggle {
  position: fixed;
  left: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 16px 0 12px;
  border: 1px solid #e6e0da;
  border-radius: 999px;
  background: #fdfbf7;
  color: #635792;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(58, 42, 92, .06), 0 14px 30px -16px rgba(58, 42, 92, .45);
  transition: opacity .3s, padding .5s cubic-bezier(.2, .7, .2, 1), border-color .3s, background .3s;
}

.motion-toggle:hover {
  border-color: #c5bcd6;
  background: #fff;
}

.motion-toggle span {
  max-width: 110px;
  margin-left: 8px;
  overflow: hidden;
  transition: max-width .5s cubic-bezier(.2, .7, .2, 1), margin .5s cubic-bezier(.2, .7, .2, 1), opacity .3s;
}

.motion-toggle.motion-folded {
  padding: 0 12px;
}

.motion-folded span {
  max-width: 0;
  margin-left: 0;
  opacity: 0;
}

.motion-toggle.motion-away,
body:has(#cookie-question:not([hidden])) .motion-toggle,
body:has(.isla-panel:not([hidden])) .motion-toggle {
  opacity: 0;
  pointer-events: none;
}

.motion-off .ribbon-track {
  animation-play-state: paused;
}

/* Below 1100px the page's words start 20 to 42px from the left edge, and a button in that corner lay over the first letters of
   every line that passed it. There it is its sign alone, above the guide's button on the right, where lines end; on a phone
   that also keeps it clear of the badge on the opening photo. Centred on the guide's button, 10px above it. */
@media (max-width: 1099px) {
  .motion-toggle {
    left: auto;
    right: 29px;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    padding: 0 12px;
  }

  .motion-toggle span {
    max-width: 0;
    margin-left: 0;
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .motion-toggle {
    right: 20px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-toggle,
  .motion-toggle span {
    transition: none;
  }
}

/* Home, the opening: the introduction film in a frame as wide as the page, a little short of the window so the next block shows
   below it. At rest a silent loop of the film's pictures plays in the frame, with the headline and the film's button over its
   bottom left corner, set like the film's own titles (serif, the italic in lavender, over a soft purple shade). While the film
   itself plays (.is-playing, set by js/site.js) the words and the shade are gone and the frame takes the film's own shape.
   On a phone the frame is a tall picture and the words stand under it on the page. */
.film-open {
  background: #fdfbf7;
}

.film-open-inner {
  padding: 14px clamp(12px, 1.6vw, 24px) 0;
}

.film-stage {
  position: relative;
}

.film-frame {
  position: relative;
  overflow: hidden;
  height: clamp(420px, calc(100svh - 84px - 14px - 84px), 920px);
  border-radius: 36px;
  background: #29272f;
  cursor: pointer;
  scroll-margin-top: 98px; /* below the menu, when the film starts and the frame is brought into view */
}

.film-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-full {
  display: none;
  object-fit: contain !important;
  background: #29272f;
}

.film-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(12deg, rgba(41, 36, 54, .86) 0%, rgba(41, 36, 54, .56) 24%, rgba(41, 36, 54, 0) 56%);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1);
  pointer-events: none;
}

.film-words {
  position: absolute;
  left: clamp(28px, 4.4vw, 72px);
  bottom: clamp(28px, 4.6vh, 60px);
  max-width: min(820px, 70%);
  pointer-events: none; /* a click on the words falls through to the frame, which plays the film; the button takes its own */
  transition: opacity .5s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}

.film-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(46px, min(6vw, 10.5vh), 96px);
  line-height: .98;
  letter-spacing: -.022em;
  color: #fdfbf7;
  text-wrap: balance;
}

.film-title em {
  color: #dcd3f0;
}

.film-play {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-top: clamp(22px, 3.4vh, 36px);
  padding: 8px 28px 8px 8px;
  border: 0;
  border-radius: 999px;
  background: #fdfbf7;
  box-shadow: 0 24px 48px -22px rgba(20, 16, 30, .7);
  font: inherit;
  font-size: 17px;
  font-weight: 500;
  color: #2f2b36;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s cubic-bezier(.2, .7, .2, 1);
}

.film-play-sign {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #635792;
  color: #fdfbf7;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.film-play-sign svg {
  margin-left: 2px; /* a triangle looks off-centre in a circle until it is moved towards its point */
}

.film-stage:hover .film-play,
.film-play:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 30px 56px -22px rgba(20, 16, 30, .8);
}

.film-stage:hover .film-play-sign {
  transform: scale(1.06);
}

.film-play:active {
  transform: translateY(0) scale(.98);
}

.film-frame:has(.film-play:focus-visible),
.film-stage:has(.film-play:focus-visible) .film-frame {
  outline: 3px solid #635792;
  outline-offset: 3px;
}

.film-stage.is-playing .film-frame {
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: calc(100svh - 84px - 28px);
  cursor: auto;
}

.film-stage.is-playing .film-full {
  display: block;
}

.film-stage.is-playing .film-loop {
  visibility: hidden;
}

.film-stage.is-playing .film-shade {
  opacity: 0;
}

.film-stage.is-playing .film-words {
  opacity: 0;
  transform: translateY(10px);
  visibility: hidden;
  transition: opacity .35s, transform .35s, visibility 0s .35s;
}

.film-said {
  margin: 6px auto 0;
  width: fit-content;
  max-width: 100%;
}

.film-said[open] {
  width: auto;
  max-width: 660px;
}

/* The opening words under the film: the first paragraph is set large, in the headline's letter */
.opening-lead {
  max-width: 19em !important;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.12;
  letter-spacing: -.015em;
  color: #2f2b36;
  text-wrap: balance;
}

@media (max-width: 700px) {
  .film-frame {
    height: auto;
    aspect-ratio: 4 / 5;
    max-height: calc(100svh - 84px - 200px);
    border-radius: 28px;
  }

  .film-shade {
    display: none;
  }

  .film-stage {
    display: grid;
  }

  .film-frame {
    grid-area: 1 / 1;
  }

  .film-words {
    display: contents;
  }

  .film-title {
    grid-area: 2 / 1;
    padding: 22px 8px 0;
    font-size: clamp(40px, 11.4vw, 56px);
    color: #2f2b36;
  }

  .film-title em {
    color: #635792;
  }

  .film-play {
    grid-area: 1 / 1;
    align-self: end;
    justify-self: start;
    z-index: 1;
    margin: 0 0 14px 14px;
  }

  .film-stage.is-playing .film-play {
    display: none;
  }

  .film-stage.is-playing .film-words {
    visibility: visible; /* the headline stays under the film while it plays */
  }

  .opening-words .story-photo {
    order: 0; /* the words first, then the photo: the film's picture is just above */
  }

  .film-said {
    margin: 10px 8px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .film-shade,
  .film-words,
  .film-play,
  .film-play-sign {
    transition: none;
  }
}

/* The opening held while the page scrolls (.film-pin, set by js/site.js on a wide screen with a mouse): the frame's place stays
   under the menu while the script grows the frame itself out to the edges of the window, and the room to scroll through is
   the empty block after it. */
.film-pin {
  padding-bottom: 100px; /* the grown frame reaches below its place by about this much */
}

.film-pin .film-open-inner::after {
  content: '';
  display: block;
  height: 95vh;
}

.film-pin .film-stage {
  position: sticky;
  top: 98px;
  z-index: 2;
  height: clamp(420px, calc(100svh - 84px - 14px - 84px), 920px);
}

.film-pin .film-frame,
.film-pin .film-stage.is-playing .film-frame {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
  will-change: height;
}

.film-pin .film-words,
.film-pin .film-shade {
  transition: none;
}

/* Held on a phone: the frame keeps its place in the page's flow, the headline under it, and the script grows it from there */
@media (max-width: 700px) {
  .film-pin .film-stage {
    height: auto;
  }

  .film-pin .film-frame,
  .film-pin .film-stage.is-playing .film-frame {
    position: relative;
    height: auto;
    aspect-ratio: 4 / 5;
    max-height: calc(100svh - 84px - 200px);
  }
}

.film-sound {
  position: absolute;
  left: 50%;
  top: 118px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px 16px 22px;
  border: 0;
  border-radius: 999px;
  background: #fdfbf7;
  box-shadow: 0 24px 48px -20px rgba(20, 16, 30, .75);
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  color: #2f2b36;
  cursor: pointer;
  animation: film-sound-in .6s cubic-bezier(.2, .7, .2, 1) both;
}

.film-sound svg {
  color: #635792;
}

@keyframes film-sound-in {
  from {
    opacity: 0;
    transform: translate(-50%, -12px);
  }
}

/* The film's own bar (made by js/site.js for a visitor with a mouse): a dark pill inside the frame, above its bottom edge.
   The large round button pauses and plays; then where the film has got to, the sound and its level, captions, full screen.
   While the film plays, the page's two floating buttons are put away: they lay over the film's bottom corners. */
.film-bar {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 3vh, 32px);
  transform: translateX(-50%);
  z-index: 2;
  display: none;
  align-items: center;
  gap: 10px;
  width: min(880px, calc(100% - 48px));
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  background: rgba(41, 36, 54, .9);
  box-shadow: 0 24px 48px -20px rgba(10, 8, 16, .8);
  color: #fdfbf7;
  cursor: auto;
  transition: opacity .35s cubic-bezier(.2, .7, .2, 1), transform .45s cubic-bezier(.2, .7, .2, 1);
}

.film-stage.is-playing .film-bar {
  display: flex;
}

.film-idle {
  cursor: none;
}

.film-idle .film-bar {
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
}

.film-bar button {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color .2s;
}

.film-bar button:hover {
  background: rgba(253, 251, 247, .14);
}

.film-bar button:focus-visible,
.film-bar input:focus-visible {
  outline: 2px solid #dcd3f0;
  outline-offset: 2px;
}

/* Picture quality stays in the custom desktop controls, clear of native touch controls. */
.film-quality {
  flex: none;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(253, 251, 247, .35);
  border-radius: 999px;
  background: rgba(41, 36, 54, .9);
  color: #fdfbf7;
  font: 500 14px/1 'DM Sans', system-ui, sans-serif;
  cursor: pointer;
}

.film-quality:focus-visible {
  outline: 2px solid #dcd3f0;
  outline-offset: 2px;
}

.film-bar .film-bar-main {
  width: 52px;
  height: 52px;
  background: #fdfbf7;
  color: #635792;
}

.film-bar .film-bar-main:hover {
  background: #fff;
}

.film-bar [aria-pressed="true"] {
  background: rgba(220, 211, 240, .28);
  color: #dcd3f0;
}

.film-bar-time {
  flex: none;
  min-width: 2.6em;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #e9e4f2;
}

.film-bar input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 24px; /* room to catch it; the line itself is drawn 4px high */
  margin: 0;
  background: transparent;
  cursor: pointer;
  --at: 0%;
}

.film-bar-seek {
  flex: 1;
  min-width: 80px;
}

.film-bar-level {
  flex: none;
  width: 92px;
}

.film-bar input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #dcd3f0 var(--at), rgba(253, 251, 247, .28) var(--at));
}

.film-bar input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #dcd3f0 var(--at), rgba(253, 251, 247, .28) var(--at));
}

.film-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fdfbf7;
}

.film-bar input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fdfbf7;
}

.film-watching .motion-toggle,
.film-watching .isla-orb {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.film-frame:fullscreen {
  border-radius: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .film-bar {
    transition: none;
  }
}

/* The film's captions, when turned on in its bar: the page's own letter at a reading size, not the browser's large default */
#intro-film::cue {
  font: 500 clamp(17px, 1.7vw, 24px) / 1.35 'DM Sans', system-ui, sans-serif;
  color: #fdfbf7;
  background: rgba(41, 36, 54, .88);
}

@media (max-width: 600px) {
  #intro-film::cue { font-size:14px; }
}

/* Footer links keep the same comfortable hit area as the main navigation. */
.footer-nav a,
.footer-meta a { display:inline-flex; align-items:center; min-height:44px; }
.footer-meta a { font-size:14px; text-underline-offset:4px; }
.footer-nav a:hover,
.footer-meta a:hover { text-decoration:underline; }

/* Resident pages share one reading rhythm; inline CMS presentation remains unchanged elsewhere. */
body[data-page="resident"] main h2 {
  font-size:clamp(40px,4.4vw,64px) !important;
  line-height:1.08 !important;
  letter-spacing:-.02em;
}
body[data-page="resident"] main :is(.story, .pillars, .wellbeing-grid) :is(h2, h3) {
  font-size:clamp(36px,3.6vw,52px) !important;
  line-height:1.1 !important;
}
body[data-page="resident"] .story { padding-block:clamp(40px,5vw,72px); }
body[data-page="resident"] .story-photo { aspect-ratio:4/3 !important; }
body[data-page="resident"] .story h4 + p { font-size:17px !important; line-height:1.7 !important; }

/* ---------------------------------------------------------------
   Whole-site pass of 14 October (phone, both iPad sizes, desktop). Layout only: no words were changed.
   --------------------------------------------------------------- */

/* The "Your ..." pages: running text is 17px on a phone everywhere (Your home and Your community had kept 18px),
   and the three points on Your energy read at 18px on a wide screen like the same text on the other four */
@media (max-width: 719px) {
  body[data-page="resident"] main :is(div, p):is([style*="font-size:18px"], [style*="font-size: 18px"]) { font-size: 17px !important; }
}
@media (min-width: 720px) {
  body[data-page="resident"] .pillars > article > p:last-child { font-size: 18px; }
}

/* Your wellbeing's card labels are set by a class rather than inline, so they missed the short rule every other label has */
main p.wellbeing-label { padding-left: 34px; }
main p.wellbeing-label::before {
  content: ""; display: inline-block; width: 22px; height: 1px; margin: 0 12px 0 -34px;
  vertical-align: middle; background: currentColor; opacity: .5; transform: translateY(-1px);
}

/* Short texts in narrow tiles left one word on their last line (a Your community tile, a Your wellbeing promise) */
body[data-page="resident"] main li > p,
#promises div > p:last-child { text-wrap: balance; }

/* For councils on an upright iPad or a phone: the opening fills the screen but its words stopped half-way down,
   over an empty half of video. Below 900px they sit at the foot of the picture, as on the home film. */
@media (max-width: 899px) {
  .council-hero { display: flex; flex-direction: column; justify-content: flex-end; }
  .council-hero > div:last-child { width: 100%; }
}

/* Page not found on an upright tablet: a whole screen of cream for three lines. Half a screen there is enough;
   the page is still taller than the screen, so no bare band shows under the footer. */
@media (min-width: 601px) and (orientation: portrait) {
  main > section:only-child { min-height: 50vh; }
}

/* Footer in two columns (600 to 999px): the address waited under the full height of the page list.
   The list takes two rows, so the address follows the company's words at the usual gap. */
@media (min-width: 600px) and (max-width: 999px) {
  .footer-nav { grid-row: span 2; }
}

/* Let's talk beside the form: the two cards were stretched to the form's height, with an empty band between their words
   and their links. They keep their own height and, on a screen tall enough, travel down beside the form. */
.contact-cards { align-self: start; }
.contact-cards > article { flex: none !important; }
@media (min-width: 1100px) and (min-height: 760px) {
  .contact-cards { position: sticky; top: 108px; }
}
