/* Colour themes, display controls and biographies */
:root {
  color-scheme: light;
  --surface: #fff;
  --surface-soft: #eef1f7;
  --surface-section: #edf1f7;
  --surface-inset: #e5eaf4;
  --header-surface: rgba(248, 249, 252, 0.93);
  --button-bg: #45378d;
  --button-hover: #232c43;
  --button-text: #fff;
  --route-text: #fff;
  --control-shadow: 0 4px 20px #232c430a;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #131923;
  --white: #1a2230;
  --ink: #e9edf5;
  --muted: #b0bccf;
  --purple: #bcb0f1;
  --coral: #ee8e9e;
  --line: #354052;
  --dark: #0e1520;
  --surface: #1a2230;
  --surface-soft: #1c2533;
  --surface-section: #19212e;
  --surface-inset: #222d3d;
  --header-surface: rgba(19, 25, 35, 0.94);
  --button-bg: #705db6;
  --button-hover: #5f4d9f;
  --button-text: #fff;
  --route-text: #141a26;
  --control-shadow: 0 4px 20px #0003;
}
body,
.people,
footer {
  background: var(--paper);
}
.header {
  background: var(--header-surface);
  border-color: var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.work {
  background: var(--surface);
}
.portrait {
  background: var(--surface-soft);
}
.approach,
.collaborate {
  background: var(--surface-section);
}
.button,
.collaborate .button {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--button-text);
}
.button:hover,
.collaborate .button:hover {
  background: var(--button-hover);
  border-color: var(--button-hover);
}
.header-link {
  background: var(--button-hover);
  border-color: var(--button-hover);
  color: #fff;
}
.header-link:hover {
  background: var(--button-bg);
  border-color: var(--button-bg);
}
.text-link {
  border-bottom-color: var(--line);
}
.skip {
  background: var(--surface);
  color: var(--ink);
}
.experience-controls {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
}
.experience-controls .motion {
  position: static;
  margin: 0;
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--control-shadow);
}
.theme-toggle {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--purple);
  box-shadow: var(--control-shadow);
}
.theme-toggle[hidden] {
  display: none;
}
.theme-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-toggle .sun {
  display: none;
}
[data-theme="dark"] .theme-toggle .sun {
  display: block;
}
[data-theme="dark"] .theme-toggle .moon {
  display: none;
}
.theme-toggle:hover,
.experience-controls .motion:hover {
  border-color: var(--purple);
}
footer {
  padding-right: 236px;
}
[data-theme="dark"] .brand {
  position: relative;
  display: block;
}
[data-theme="dark"] .brand img {
  filter: brightness(0) invert(1);
}
/* Preserve the coloured parts of the logo in dark mode. */
[data-theme="dark"] .brand::before,
[data-theme="dark"] .brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url("../assets/prepaid-logo.webp") center/100% 100% no-repeat;
  pointer-events: none;
}
[data-theme="dark"] .brand::before {
  clip-path: inset(0 67% 0 0);
}
[data-theme="dark"] .brand::after {
  clip-path: inset(0 13% 0 70%);
}
[data-theme="dark"] .nav-ready .header nav a {
  border-color: var(--line);
}
[data-theme="dark"] .header nav {
  background: var(--paper);
}
[data-theme="dark"] .hero-background {
  opacity: 1;
}
.motion-enabled .motion-reveal {
  transform: translate3d(0, 16px, 0);
  transition:
    opacity 0.5s var(--ease) var(--reveal-delay, 0s),
    transform 0.65s var(--ease) var(--reveal-delay, 0s);
}
.motion-enabled .motion-reveal.is-visible {
  transform: none;
}
.motion-enabled .hero-copy .motion-reveal {
  transition-delay: 0s;
}
.motion-enabled :where(.button, .header-link, .scenario-tabs button, .theme-toggle, .motion) {
  transition:
    background-color 0.22s,
    border-color 0.22s,
    color 0.22s,
    transform 0.3s var(--ease),
    box-shadow 0.3s;
}
.motion-enabled :where(.button, .header-link, .theme-toggle, .motion):active {
  transform: translateY(1px) scale(0.985);
}
.motion-enabled .header nav a {
  transition:
    color 0.22s,
    border-color 0.22s;
}
.motion-enabled .reading-progress span {
  transition: transform 0.09s linear;
}
.motion-enabled details[open] > div {
  animation: detail-enter 0.28s var(--ease) both;
}
.motion-enabled .header[data-menu-open="true"] nav {
  animation: menu-enter 0.24s var(--ease) both;
}
.motion-enabled.theme-transition
  :where(
    body,
    .header,
    .care-band,
    .section,
    .workflow-story,
    .workflow-output,
    .case-map,
    .project-status,
    .portrait,
    footer,
    .theme-toggle,
    .motion,
    .scenario-tabs button
  ) {
  transition:
    background-color 0.28s,
    color 0.22s,
    border-color 0.28s;
}
.theme-transition .hero-background {
  transition: opacity 0.28s;
}
html[data-motion="paused"] {
  scroll-behavior: auto;
}
body:not(.motion-enabled),
body:not(.motion-enabled) *,
body:not(.motion-enabled) *::before,
body:not(.motion-enabled) *::after {
  transition: none !important;
  animation: none !important;
}
body:not(.motion-enabled) :where(.button, .header-link, .theme-toggle, .motion):hover,
body:not(.motion-enabled) :where(.button, .header-link, .theme-toggle, .motion):active {
  transform: none !important;
}
@keyframes detail-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes menu-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (hover: hover) and (pointer: fine) {
  .motion-enabled .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px #45378d16;
  }
  .motion-enabled .theme-toggle:hover {
    transform: translateY(-1px);
  }
}
@media (max-width: 820px) {
  [data-theme="dark"] .header nav {
    background: var(--paper);
  }
}
@media (max-width: 700px) {
  .experience-controls {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    gap: 7px;
  }
  .experience-controls .motion {
    min-width: 126px;
  }
  footer {
    padding-right: var(--pad);
    padding-bottom: 88px;
  }
  .motion-enabled .motion-reveal {
    transform: translate3d(0, 12px, 0);
    transition-delay: 0s;
  }
  .motion-enabled .motion-reveal.is-visible {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .theme-transition .hero-background {
    transition: none;
  }
  .motion-enabled details[open] > div,
  .motion-enabled .header[data-menu-open="true"] nav {
    animation: none;
  }
}

/* Inline biographies preserve a compact roster until a reader asks for more. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.team-bio {
  margin-top: 12px;
  max-width: 64ch;
  overflow: clip;
}
html.bio-changing,
html.bio-changing body {
  overflow-anchor: none;
}
.team-bio summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 44px;
  padding: 7px 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--purple);
  border-bottom: 1px solid var(--line);
}
.team-bio summary:hover {
  border-color: var(--purple);
}
.team-bio summary > span,
.team-bio[open] > summary > span {
  transform: none;
}
.team-bio summary svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.team-bio .bio-close {
  display: none;
}
.team-bio[open] .bio-read {
  display: none;
}
.team-bio[open] .bio-close {
  display: inline;
}
.team-bio[open] summary svg {
  transform: rotate(45deg);
}
.team-bio .bio-content {
  padding: 16px 0 4px;
}
.team-bio .bio-content p {
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
  color: var(--muted);
}
.team-bio .bio-content p + p {
  margin-top: 14px;
}
.team-bio .bio-content em {
  font-style: italic;
}
.motion-enabled .team-bio summary svg {
  transition: transform 0.25s var(--ease);
}
.motion-enabled .team-bio[open] > .bio-content {
  animation: detail-enter 0.28s var(--ease) both;
}
@media (max-width: 700px) {
  .team-member figcaption {
    display: contents;
  }
  .team-member .portrait {
    grid-row: 1/3;
  }
  .team-member figcaption h3 {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }
  .team-member .team-role {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin: 0;
  }
  .team-member .team-focus {
    grid-column: 1/-1;
    margin: 0;
  }
  .team-bio {
    grid-column: 1/-1;
    margin-top: -4px;
    max-width: none;
  }
  .team-bio .bio-content {
    padding-top: 14px;
  }
}
