/* Aerospherical Software */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --text: #0e1116;
  --muted: #596170;
  --rule: #e4e7ec;
  --link: #0e1116;
  --focus: #2450ff;
  --surface: #f6f7f9;
  --accent: #2450ff;
  --accent-soft: #eef2ff;
  --band-bg: #0e1116;
  --band-text: #f2f4f7;
  --band-muted: #9aa3b2;

  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --measure: 42rem;
  --wide: 64rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --text: #f2f4f7;
    --muted: #9aa3b2;
    --rule: #252a33;
    --link: #f2f4f7;
    --focus: #7b9bff;
    --surface: #151a22;
    --accent: #7b9bff;
    --accent-soft: #1a2240;
    --band-bg: #151a22;
    --band-text: #f2f4f7;
    --band-muted: #9aa3b2;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--muted);
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100%;
  padding: 0.5rem 0.75rem;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}

/* Where supported, the bar starts clear and fades in over the first
   stretch of scrolling. No JavaScript needed. */
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-settle linear both;
    animation-timeline: scroll(root);
    animation-range: 0 6rem;
  }

  @keyframes header-settle {
    from {
      background-color: transparent;
      border-bottom-color: transparent;
    }

    to {
      background-color: color-mix(in srgb, var(--bg) 88%, transparent);
      border-bottom-color: var(--rule);
    }
  }
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.25rem;
}

.wordmark {
  display: block;
  line-height: 0;
}

.wordmark img {
  width: auto;
  height: 1.75rem;
}

@media (min-width: 30rem) {
  .wordmark img {
    height: 2rem;
  }
}

@media (min-width: 48rem) {
  .wordmark img {
    height: 2.375rem;
  }
}

.site-nav ul {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.menu-button {
  display: none;
}

/* Narrow screens, or heavy zoom: the links move into a menu opened by a
   button (the popover attribute, so no JavaScript). Browsers without
   popover support keep the inline links. */
@supports selector(:popover-open) {
  @media (max-width: 59.99rem) {
    .menu-button {
      display: grid;
      place-items: center;
      width: 2.75rem;
      height: 2.75rem;
      margin-right: -0.625rem;
      padding: 0;
      border: 0;
      border-radius: 0.75rem;
      background: transparent;
      color: var(--text);
      cursor: pointer;
    }

    .menu-button:hover {
      background: var(--surface);
    }

    .site-nav ul {
      position: fixed;
      inset: 4.25rem var(--gutter) auto auto;
      width: min(16rem, calc(100vw - 2 * var(--gutter)));
      margin: 0;
      padding: 0.5rem;
      flex-direction: column;
      gap: 0;
      border: 1px solid var(--rule);
      border-radius: 1rem;
      background: var(--bg);
      color: var(--text);
      box-shadow: 0 18px 40px -16px rgb(14 17 22 / 0.3);
    }

    .site-nav ul:not(:popover-open) {
      display: none;
    }

    .site-nav ul a {
      display: block;
      padding: 0.75rem 1rem;
      border-radius: 0.625rem;
      color: var(--text);
      font-size: 1.0625rem;
    }

    .site-nav ul a:hover {
      background: var(--surface);
    }
  }
}

/* The menu is a popover everywhere, but on wide screens it is shown as
   the ordinary inline nav. */
@media (min-width: 60rem) {
  .site-nav ul[popover] {
    position: static;
    inset: auto;
    display: flex;
    width: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: none;
    color: inherit;
  }
}

/* Without popover support the inline nav stays, so it still has to fit. */
@supports not selector(:popover-open) {
  .site-nav ul[popover] {
    position: static;
    display: flex;
    inset: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    gap: clamp(0.625rem, 3vw, 1.5rem);
    font-size: clamp(0.875rem, 3vw, 1rem);
  }
}

.site-nav a:hover {
  color: var(--text);
}

/* Intro */

.intro {
  padding-block: clamp(4rem, 14vw, 9rem) clamp(4rem, 10vw, 7rem);
}

.intro h1 {
  max-width: 32ch;
  font-size: clamp(2.125rem, 6vw, 3.5rem);
  letter-spacing: -0.025em;
}

.intro p {
  max-width: var(--measure);
  text-wrap: balance;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
}

/* Sections */

.section {
  padding-block: clamp(3.5rem, 9vw, 6rem);
  border-top: 1px solid var(--rule);
}

.section > .wrap {
  display: grid;
  gap: 2rem;
}

.section h2 {
  font-size: 1.0625rem;
  letter-spacing: 0;
}

@media (min-width: 48rem) {
  .section > .wrap {
    grid-template-columns: 14rem 1fr;
    gap: 3rem;
  }
}

.services {
  display: grid;
  gap: 3rem;
  max-width: var(--measure);
  padding: 0;
  list-style: none;
}

.services h3 {
  font-size: clamp(1.375rem, 3vw, 1.625rem);
}

.services p {
  margin-top: 0.75rem;
  color: var(--muted);
}

.services p + p {
  margin-top: 0.75rem;
}

.contact {
  max-width: var(--measure);
}

.contact p {
  color: var(--muted);
}

.contact .email {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: clamp(1.25rem, 4.2vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

/* Prose pages */

.prose {
  max-width: var(--measure);
  padding-block: clamp(3rem, 10vw, 6rem);
}

.prose h1 {
  font-size: clamp(1.875rem, 5vw, 2.5rem);
  letter-spacing: -0.02em;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: 1.1875rem;
}

.prose p,
.prose ul {
  margin-top: 1rem;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

.prose .updated {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 2rem 2.5rem;
}

/* The legal text takes the free width and wraps only when it runs out.
   Plain wrapping, because Safari's "pretty" wrapping shrinks a flex item
   to well under its available width. */
.site-footer p:first-child {
  flex: 1 1 20rem;
  text-wrap: wrap;
}

.site-footer p:last-child {
  flex: none;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* Work */

.work-intro {
  max-width: 56rem;
  padding-block: clamp(3.5rem, 11vw, 7rem) clamp(2.5rem, 6vw, 4rem);
}

.work-intro h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  letter-spacing: -0.03em;
}

.work-intro p {
  margin-top: 1.25rem;
  text-wrap: balance;
  color: var(--muted);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
}

.projects {
  display: grid;
  gap: clamp(5rem, 14vw, 10rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

.project {
  scroll-margin-top: 6rem;
}

.project-visual {
  margin: 0;
  overflow: hidden;
  border-radius: clamp(1rem, 2.4vw, 1.75rem);
  background: var(--rule);
  box-shadow:
    0 1px 2px rgb(14 17 22 / 0.06),
    0 24px 60px -24px rgb(14 17 22 / 0.28);
}

.project-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.project-visual--starhollow img {
  image-rendering: pixelated;
}

.project-info {
  display: grid;
  gap: 1.5rem;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
}

@media (min-width: 48rem) {
  .project-info {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 3rem;
  }
}

.project-title {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.project-icon {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 22%;
  box-shadow: 0 0 0 1px var(--rule);
}

.project-title h2 {
  font-size: clamp(1.625rem, 3.6vw, 2.25rem);
  letter-spacing: -0.02em;
}

.project-tag {
  margin-top: 0.35rem;
  text-wrap: balance;
  color: var(--muted);
}

.project-detail p {
  color: var(--muted);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
}

.project-meta li {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.project-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-weight: 600;
}

/* Work on the home page */

.work-grid {
  display: grid;
  gap: 2rem 1.5rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 36rem) {
  .work-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.work-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.work-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1rem;
  box-shadow:
    0 1px 2px rgb(14 17 22 / 0.06),
    0 16px 40px -20px rgb(14 17 22 / 0.3);
}

.work-card-name {
  display: block;
  margin-top: 1rem;
  font-weight: 600;
}

.work-card-tag {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
}

.work-more {
  margin-top: 2.25rem;
}

/* Cards, steps, panels, FAQ and the contact band */

.section--stack > .wrap {
  display: block;
}

.section--stack h2 {
  max-width: 32ch;
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  letter-spacing: -0.02em;
}

.lead {
  display: grid;
  gap: 1rem;
  max-width: var(--measure);
  font-size: clamp(1.0625rem, 2vw, 1.1875rem);
}

.lead p + p {
  color: var(--muted);
}

.cards {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 60rem) {
  .cards--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card--span2 {
    grid-column: span 2;
  }

  .card--span3 {
    grid-column: 1 / -1;
  }
}

@media (min-width: 40rem) and (max-width: 59.99rem) {
  .card--span2,
  .card--span3 {
    grid-column: 1 / -1;
  }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 1.25rem;
  background: var(--surface);
}

.card h3 {
  font-size: 1.1875rem;
}

.card p {
  color: var(--muted);
}

.card-icon {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.625rem;
  border-radius: 0.875rem;
  background: var(--accent-soft);
  color: var(--accent);
}

.card--feature {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.card--feature .card-icon {
  background: var(--accent);
  color: var(--bg);
}

.card--feature p {
  color: var(--text);
}

.steps {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 40rem) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 60rem) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.step {
  counter-increment: step;
  padding-top: 1.25rem;
  border-top: 2px solid var(--rule);
}

.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}

.step h3 {
  font-size: 1.125rem;
}

.step p {
  margin-top: 0.5rem;
  color: var(--muted);
}

.panel {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  max-width: var(--measure);
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: 1.25rem;
  background: var(--surface);
}

.faq {
  max-width: var(--measure);
  border-top: 1px solid var(--rule);
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  color: var(--muted);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.1;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding-bottom: 1.25rem;
  color: var(--muted);
}

.band {
  padding-block: clamp(4rem, 10vw, 7rem);
  background: var(--band-bg);
  color: var(--band-text);
}

.band h2 {
  max-width: 24ch;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  letter-spacing: -0.025em;
}

.band p {
  max-width: var(--measure);
  margin-top: 1rem;
  color: var(--band-muted);
  font-size: clamp(1.0625rem, 2vw, 1.1875rem);
}

.band .email {
  display: inline-block;
  margin-top: 1.75rem;
  color: var(--band-text);
  font-size: clamp(1.25rem, 4.2vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  text-decoration-color: var(--band-muted);
}

.band .email:hover {
  text-decoration-color: currentColor;
}

.band :focus-visible {
  outline-color: #7b9bff;
}

/* Motion. Everything above renders complete without it. */

@media (prefers-reduced-motion: no-preference) {
  .work-card img {
    transition:
      transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
      box-shadow 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .card {
    transition: border-color 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .card:hover {
    border-color: color-mix(in srgb, var(--accent) 35%, var(--rule));
  }

  .work-card:hover img {
    transform: translateY(-4px);
    box-shadow:
      0 1px 2px rgb(14 17 22 / 0.06),
      0 28px 50px -22px rgb(14 17 22 / 0.38);
  }

  .intro h1,
  .intro p,
  .work-intro h1,
  .work-intro p {
    animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .intro p,
  .work-intro p {
    animation-delay: 0.12s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(1rem);
    }
  }

  @supports (animation-timeline: view()) {
    .project-visual,
    .work-grid li,
    .project-info,
    .services li,
    .cards li,
    .step,
    .points li,
    .panel {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }

    .project-visual img {
      animation: drift linear both;
      animation-timeline: view();
      animation-range: cover;
    }

    @keyframes settle {
      from {
        opacity: 0;
        transform: translateY(3rem) scale(0.97);
      }
    }

    @keyframes drift {
      from {
        transform: scale(1.08) translateY(-3%);
      }

      to {
        transform: scale(1.08) translateY(3%);
      }
    }
  }
}

/* Stacking cards: each card sticks a little lower than the one before,
   so earlier cards stay visible as a row of tabs while the next slides
   over them. Pure CSS (position: sticky). */

.stack {
  --stack-top: 4.75rem;
  --stack-step: 0.75rem;
  display: grid;
  gap: 1.25rem;
  padding: 0;
  list-style: none;
}

.stack {
  /* Every card the same height as the tallest, so a shorter card never
     leaves the one beneath it showing. */
  grid-auto-rows: 1fr;
}

@media (min-width: 48rem) {
  .stack {
    --stack-top: 5.5rem;
    --stack-step: 2.75rem;
  }
}

.stack-card {
  --i: 0;
  --card-bg: #eef2ff;
  --card-ink: var(--text);
  --card-muted: #4b5466;
  --card-accent: var(--accent);
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: min(28rem, calc(100svh - var(--stack-top) - var(--i) * var(--stack-step) - 1.5rem));
  padding: 0 clamp(1.5rem, 4vw, 3rem) clamp(1.75rem, 4vw, 3rem);
  border-radius: clamp(1.25rem, 3vw, 2rem);
  background: var(--card-bg);
  color: var(--card-ink);
  box-shadow: 0 -1px 0 rgb(14 17 22 / 0.04), 0 -18px 40px -28px rgb(14 17 22 / 0.35);
}

.stack-card:nth-child(2) { --i: 1; --card-bg: #e7f2ef; --card-accent: #0f7a66; }
.stack-card:nth-child(3) { --i: 2; --card-bg: #f4efe6; --card-accent: #9a5b13; }
.stack-card:nth-child(4) { --i: 3; --card-bg: #0e1116; --card-ink: #f2f4f7; --card-muted: #aab2c0; --card-accent: #7b9bff; }
.stack-card:nth-child(5) { --i: 4; --card-bg: #eeebf8; --card-accent: #5b3fc4; }
.stack-card:nth-child(6) { --i: 5; --card-bg: #e9eef5; --card-accent: #2f5577; }
.stack-card:nth-child(7) { --i: 6; }
.stack-card:nth-child(8) { --i: 7; }

@media (prefers-color-scheme: dark) {
  .stack-card { --card-bg: #18203a; --card-muted: #a9b2c3; }
  .stack-card:nth-child(2) { --card-bg: #13272a; --card-accent: #5fd0b8; }
  .stack-card:nth-child(3) { --card-bg: #2a241b; --card-accent: #e3a861; }
  .stack-card:nth-child(4) { --card-bg: #2450ff; --card-ink: #ffffff; --card-muted: #dbe3ff; --card-accent: #ffffff; }
  .stack-card:nth-child(5) { --card-bg: #221d38; --card-accent: #b3a1ff; }
  .stack-card:nth-child(6) { --card-bg: #172230; --card-accent: #8db7dc; }

  .stack-card {
    box-shadow: 0 -1px 0 rgb(255 255 255 / 0.06), 0 -18px 40px -24px rgb(0 0 0 / 0.7);
  }
}

.stack-tab {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  height: 3rem;
  color: var(--card-ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

.stack-tab span {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 1.5rem;
  padding-inline: 0.375rem;
  border-radius: 999px;
  background: var(--card-accent);
  color: var(--card-bg);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.stack-body {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding-top: clamp(0.5rem, 3vw, 2rem);
}

@media (min-width: 48rem) {
  .stack-body {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 3rem;
  }
}

.stack-text h3 {
  max-width: 18ch;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}

.stack-text p {
  max-width: 36rem;
  margin-top: 1rem;
  color: var(--card-muted);
  font-size: clamp(1.0625rem, 1.8vw, 1.1875rem);
}

.stack-text p a,
.stack-link {
  color: var(--card-ink);
}

.stack-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-weight: 600;
  text-decoration-color: color-mix(in srgb, var(--card-accent) 60%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.stack-link::after {
  content: " \2192";
}

.stack-visual {
  justify-self: center;
  width: min(100%, 18rem);
  height: auto;
  color: var(--card-accent);
  overflow: visible;
}

@media (max-width: 47.99rem) {
  .stack-card {
    min-height: 0;
  }

  .stack-body {
    align-content: start;
  }

  .stack-visual {
    order: -1;
    justify-self: start;
    width: 5rem;
  }
}

.stack-sphere {
  fill: color-mix(in srgb, var(--card-accent) 14%, transparent);
}

.stack-orbit {
  fill: none;
  stroke: color-mix(in srgb, var(--card-accent) 45%, transparent);
  stroke-width: 2;
  transform-origin: 120px 120px;
}

.stack-moon {
  fill: var(--card-accent);
  stroke: none;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .stack-orbit {
      animation: orbit linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 0%;
    }

    .stack-text {
      animation: settle linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 35%;
    }

    @keyframes orbit {
      from {
        transform: rotate(-40deg);
      }

      to {
        transform: rotate(10deg);
      }
    }
  }
}

@media (max-width: 22.99rem) {
  .stack-visual {
    display: none;
  }
}

/* Cards only stick when the screen is tall enough to show a whole card
   below the tabs; on short screens they scroll as an ordinary list. */
@media (min-width: 48rem) and (min-height: 48rem), (max-width: 47.99rem) and (min-height: 45rem) {
  .stack-card {
    position: sticky;
    top: calc(var(--stack-top) + var(--i) * var(--stack-step));
  }

  /* Room after the last card (one row tall) so it settles onto the
     stack and holds there before the whole stack scrolls away. It has to
     be content rather than padding, because sticky cards cannot move into
     the list's padding. */
  .stack::after {
    content: "";
    margin-top: -1.25rem;
  }
}

/* About: map of the UK with a pin on Liverpool */

.intro--map {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 56rem) {
  .intro--map {
    grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
    gap: 4rem;
    padding-block: clamp(2rem, 6vw, 4rem);
  }
}

.intro-map {
  margin: 0;
  width: min(100%, 15rem);
}

@media (max-width: 35.99rem) {
  .intro-map {
    display: none;
  }
}

@media (min-width: 56rem) {
  .intro-map {
    width: 100%;
  }
}

.intro-map svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.map-land {
  fill: color-mix(in srgb, var(--accent) 9%, var(--bg));
  stroke: color-mix(in srgb, var(--accent) 35%, transparent);
  stroke-width: 1;
  stroke-linejoin: round;
}

.map-pin {
  fill: var(--accent);
}

.map-pin-dot {
  fill: var(--bg);
}

.map-shadow {
  fill: rgb(14 17 22 / 0.18);
}

.map-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0;
}

.map-label {
  fill: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
}

@media (prefers-reduced-motion: no-preference) {
  .map-pin,
  .map-pin-dot {
    animation: pin-drop 0.8s cubic-bezier(0.3, 1.4, 0.5, 1) 0.3s both;
  }

  .map-pulse {
    transform-box: fill-box;
    transform-origin: center;
    animation: pin-pulse 2.4s ease-out 1.1s infinite;
  }

  @keyframes pin-drop {
    from {
      opacity: 0;
      transform: translateY(-40px);
    }
  }

  @keyframes pin-pulse {
    0% {
      opacity: 0.7;
      transform: scale(1);
    }

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

/* Links listed inside a stacking card (the services hub) */

.stack-links {
  display: grid;
  gap: 0.25rem 1.5rem;
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 36rem) {
  .stack-links {
    grid-template-columns: repeat(2, minmax(0, max-content));
  }
}

.stack-links a {
  display: inline-block;
  padding-block: 0.25rem;
  color: var(--card-ink);
  font-weight: 600;
  text-decoration-color: color-mix(in srgb, var(--card-accent) 60%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.stack-links a::after {
  content: "\00a0\2192";
  color: var(--card-accent);
}

/* Small link back to the parent page, above a page heading */

.crumb {
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.crumb a {
  color: var(--muted);
  text-decoration: none;
}

.crumb a::before {
  content: "\2190\00a0";
}

.crumb a:hover {
  color: var(--text);
}

/* Plain list of points: no boxes, a rule above each. */

.points {
  display: grid;
  gap: 2rem 3rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 60rem) {
  .points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.points li {
  padding-top: 1.25rem;
  border-top: 2px solid var(--rule);
}

.points h3 {
  font-size: 1.125rem;
}

.points h3 a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.points h3 a::after {
  content: "\00a0\2192";
  color: var(--accent);
}

.points p {
  margin-top: 0.5rem;
  color: var(--muted);
}

/* Service and about pages */

div.services {
  gap: 1rem;
}

div.services p {
  margin-top: 0;
}

div.services h3 + p {
  margin-top: 0.75rem;
}

.details {
  display: grid;
  gap: 1rem;
  max-width: var(--measure);
  margin: 0;
}

.details div {
  display: grid;
  gap: 0.125rem;
}

@media (min-width: 36rem) {
  .details div {
    grid-template-columns: 9rem 1fr;
    gap: 1rem;
  }
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
}

.person {
  display: grid;
  gap: 1.25rem;
  max-width: var(--measure);
}

@media (min-width: 36rem) {
  .person {
    grid-template-columns: 9rem 1fr;
    gap: 2rem;
    align-items: start;
  }
}

.person img {
  display: block;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: var(--rule);
}

.person h3 {
  font-size: clamp(1.375rem, 3vw, 1.625rem);
}

.person p {
  margin-top: 0.75rem;
  color: var(--muted);
}

/* Case study */

.intro--case {
  padding-bottom: clamp(2.5rem, 6vw, 3.5rem);
}

.intro--case .project-meta {
  margin-top: 1.75rem;
}

.case-hero {
  margin-bottom: clamp(3.5rem, 9vw, 6rem);
}

.phones {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * var(--phones-gap)) / 2.4);
  gap: var(--phones-gap);
  margin: 0;
  padding: 0 0 1.25rem;
  list-style: none;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0;
  scrollbar-width: thin;
  --phones-gap: clamp(1rem, 3vw, 2rem);
}

@media (min-width: 48rem) {
  .phones {
    grid-auto-columns: calc((100% - 3 * var(--phones-gap)) / 3.6);
  }
}

.phones li {
  scroll-snap-align: start;
}

.phones img {
  display: block;
  width: 100%;
  height: auto;
}

.phones:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@supports selector(::scroll-button(right)) {
  .phones {
    anchor-name: --phones;
  }

  .phones::scroll-button(*) {
    position: absolute;
    position-anchor: --phones;
    top: calc(anchor(center) - 1.375rem);
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--rule);
    border-radius: 50%;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 6px 18px -8px rgb(14 17 22 / 0.35);
  }

  .phones::scroll-button(*):disabled {
    opacity: 0;
    pointer-events: none;
  }

  .phones::scroll-button(left) {
    content: "\2190" / "Previous screens";
    left: calc(anchor(left) - 1rem);
  }

  .phones::scroll-button(right) {
    content: "\2192" / "Next screens";
    right: calc(anchor(right) - 1rem);
  }
}
