/* Hellosoftware — hellosoftware.co.uk
   Layout: a dark stage with one tile language. Flat shapes (square, circle,
   quarter, arch, triangle) build the logo, the hero mosaic, the service
   icons, each project's cover and the footer band. Type is wide and bold,
   with one highlighted phrase per heading. Deliberately dark-only. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #0c0f1d;
  --surface: #151a2e;
  --surface-2: #1d2440;
  --paper: #f3f4f8;
  --muted: #a7aec8;
  --dim: #5f6892;
  --line: rgb(255 255 255 / 0.1);

  --orange: #ff7a1a;
  --blue: #5b84ff;
  --mint: #3ee6a8;
  --lilac: #b69cff;
  --rose: #ff5c7a;

  --font-display: "Archivo", "Arial Black", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step-0: 1.0625rem;
  --step-1: clamp(1.15rem, 1.6vw, 1.3rem);
  --step-2: clamp(1.4rem, 2.4vw, 1.75rem);
  --step-3: clamp(2.2rem, 5.6vw, 4rem);
  --step-4: clamp(2.6rem, 7.6vw, 6.2rem);

  --gutter: clamp(16px, 4vw, 48px);
  --measure: 36rem;
  --ease-pop: cubic-bezier(0.3, 1.5, 0.5, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

main:focus {
  outline: none;
}

.wrap {
  width: 100%;
  max-width: 78rem;
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Tiles: the one visual language ---------- */

.tile {
  display: block;
  aspect-ratio: 1;
  background: var(--c, transparent);
  rotate: var(--r, 0deg);
}

.t-square {
  border-radius: 6%;
}

.t-circle {
  border-radius: 50%;
}

/* Quarter disc, centred on the bottom-right corner. */
.t-quarter {
  border-top-left-radius: 100%;
}

/* Arch: a half-ellipse dome standing on the bottom edge. */
.t-arch {
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.t-tri {
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.t-blank {
  background: none;
}

/* ---------- Header ---------- */

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  font-stretch: 120%;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark__mark {
  display: grid;
  grid-template-columns: repeat(2, 0.8rem);
  gap: 2px;
}

.wordmark:hover .wordmark__mark .tile {
  rotate: calc(var(--r, 0deg) + 90deg);
}

.wordmark__mark .tile {
  transition: rotate 0.4s var(--ease-pop);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.5rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.site-nav a:hover {
  border-color: var(--line);
  background: var(--surface);
}

/* ---------- Shared type ---------- */

.kicker {
  margin-bottom: 1.25rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hl {
  color: var(--hl);
}

.hl--orange { --hl: var(--orange); }
.hl--mint { --hl: var(--mint); }
.hl--lilac { --hl: var(--lilac); }

.section {
  padding-block: clamp(4.5rem, 10vw, 8rem);
}

.section-head {
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.section-title {
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.1rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.pill--light {
  background: var(--paper);
  color: var(--bg);
}

.pill--light:hover {
  background: var(--orange);
}

.pill--ghost {
  border-color: rgb(255 255 255 / 0.3);
  background: transparent;
  color: var(--paper);
}

.pill--ghost:hover {
  border-color: var(--paper);
}

.pill__arrow {
  width: 1em;
  height: 1em;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: translate 0.25s var(--ease-pop);
}

.pill:hover .pill__arrow,
.project__link:hover .pill__arrow {
  translate: 4px 0;
}

/* ---------- Hero ---------- */

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(3rem, 7vw, 5rem);
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(4rem, 9vw, 7rem);
}

@media (min-width: 62rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }
}

.hero__copy {
  min-width: 0;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero__lead {
  max-width: var(--measure);
  margin-top: 1.75rem;
  color: var(--muted);
  font-size: var(--step-1);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* The mosaic: tiles pop in on load, and a few keep turning. */
.mosaic {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 10px);
  width: 100%;
  max-width: 30rem;
  justify-self: center;
}

@media (prefers-reduced-motion: no-preference) {
  .mosaic .tile {
    animation: pop 0.7s var(--ease-pop) both;
    animation-delay: calc(var(--d, 0) * 60ms + 150ms);
  }
  .mosaic .spin {
    animation:
      pop 0.7s var(--ease-pop) both calc(var(--d, 0) * 60ms + 150ms),
      turn 7s cubic-bezier(0.7, 0, 0.3, 1) infinite calc(var(--s, 1) * 1.3s + 1.5s);
  }
  .project:hover .project__cover .tile,
  .project:focus-within .project__cover .tile {
    rotate: calc(var(--r, 0deg) + 90deg);
  }
  .project__cover .tile {
    transition: rotate 0.6s var(--ease-pop);
  }
  .project__cover .tile:nth-child(2) { transition-delay: 40ms; }
  .project__cover .tile:nth-child(3) { transition-delay: 80ms; }
  .project__cover .tile:nth-child(4) { transition-delay: 120ms; }
  .project__cover .tile:nth-child(5) { transition-delay: 160ms; }
  .project__cover .tile:nth-child(6) { transition-delay: 200ms; }
}

@keyframes pop {
  from { scale: 0; }
  to { scale: 1; }
}

@keyframes turn {
  0%, 60% { rotate: var(--r, 0deg); }
  75%, 100% { rotate: calc(var(--r, 0deg) + 90deg); }
}

/* ---------- Services ---------- */

.statement {
  display: grid;
  margin-bottom: clamp(3rem, 7vw, 5rem);
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.statement span {
  color: var(--c);
}

/* Each line lights up as it scrolls into view, where the browser supports
   scroll-driven animation. Elsewhere the lines are simply lit. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .statement span {
      animation: light linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 40%;
    }
  }
}

@keyframes light {
  from { color: var(--dim); }
  to { color: var(--c); }
}

.services {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

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

.service {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface);
}

.service__icon {
  width: 3.25rem;
  margin-bottom: 0.75rem;
}

.service__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 750;
  font-stretch: 112%;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

/* ---------- Projects ---------- */

.projects {
  display: grid;
  gap: 1.25rem;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.75rem;
  background: var(--surface);
}

@media (min-width: 56rem) {
  .project {
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  }
}

/* One strip of six tiles when stacked; a 3 × 2 block beside the text on wide screens. */
.project__cover {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-content: center;
  gap: 6px;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--surface-2);
}

@media (min-width: 56rem) {
  .project__cover {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

.project__body {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 2.75rem);
}

.project__name {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 800;
  font-stretch: 115%;
  line-height: 1;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
}

.project__meta {
  color: var(--c1);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
}

.project__body > p:not([class]) {
  max-width: var(--measure);
  color: var(--muted);
}

.points {
  display: grid;
  gap: 0.5rem;
}

.points li {
  display: flex;
  gap: 0.75rem;
}

.points li::before {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  margin-top: 0.55em;
  border-radius: 50%;
  background: var(--c1);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.tags li {
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
}

.project__link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: start;
  margin-top: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  background: var(--paper);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s;
}

.project__link:hover {
  background: var(--c1);
}

/* ---------- Contact ---------- */

.contact__inner {
  display: grid;
  justify-items: start;
}

.contact__title {
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.contact__lead {
  max-width: var(--measure);
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: var(--step-1);
}

.contact__email {
  max-width: 100%;
  margin-top: 2.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5.2vw, 3.2rem);
  font-weight: 750;
  font-stretch: 110%;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.contact__email a {
  text-decoration: underline;
  text-decoration-color: var(--lilac);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.contact__email a:hover {
  color: var(--lilac);
}

.contact__copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.5rem;
}

.contact__status {
  color: var(--mint);
  font-weight: 600;
}

/* ---------- Footer ---------- */

.footer-band {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.footer-band .tile {
  border-radius: 0;
}

.footer-band .t-circle {
  border-radius: 50%;
}

.footer-band .t-quarter {
  border-top-left-radius: 100%;
}

.footer-band .t-arch {
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

/* ---------- Sub-pages ---------- */

.site-nav a[aria-current="page"],
.site-nav a.is-section {
  border-color: rgb(255 255 255 / 0.3);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  margin: 0;
  padding: 0.5rem 0 0;
  list-style: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 0.6rem;
  color: var(--dim);
}

.crumbs a {
  color: var(--paper);
}

.page-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
}

@media (min-width: 56rem) {
  .page-hero__grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  }
}

.page-hero__copy {
  display: grid;
  justify-items: start;
  min-width: 0;
}

.page-hero__title {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.page-hero__lead {
  max-width: var(--measure);
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: var(--step-1);
}

.page-hero__meta {
  margin-top: 1rem;
}

.page-hero__tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 14rem;
  justify-self: start;
}

.page-hero__tiles--six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 18rem;
}

@media (min-width: 56rem) {
  .page-hero__tiles {
    justify-self: end;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .page-hero__tiles .tile {
    animation: pop 0.6s var(--ease-pop) both;
  }
  .page-hero__tiles .tile:nth-child(2) { animation-delay: 80ms; }
  .page-hero__tiles .tile:nth-child(3) { animation-delay: 160ms; }
  .page-hero__tiles .tile:nth-child(4) { animation-delay: 240ms; }
  .page-hero__tiles .tile:nth-child(5) { animation-delay: 320ms; }
  .page-hero__tiles .tile:nth-child(6) { animation-delay: 400ms; }
}

.section--tight {
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
}

.block-title {
  margin-bottom: 1.5rem;
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  font-stretch: 115%;
  letter-spacing: -0.015em;
}

.prose {
  max-width: 42rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.prose + .prose {
  margin-top: 1rem;
}

.prose a {
  color: var(--paper);
}

.features {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

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

/* Three items sit in one row rather than leaving one alone. */
@media (min-width: 62rem) {
  .features:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 1.5rem;
  border-top: 3px solid var(--c1, var(--orange));
  border-radius: 0 0 1.25rem 1.25rem;
  background: var(--surface);
}

.feature__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 750;
  font-stretch: 110%;
}

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

/* Cards whose heading link covers the whole card. */
.service,
.related__item {
  position: relative;
}

.card-link {
  text-decoration: none;
}

.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card-link:focus-visible {
  outline: none;
}

.card-link:focus-visible::after {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

.service:hover,
.related__item:hover {
  border-color: rgb(255 255 255 / 0.35);
}

.service__title a {
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 0.25);
  text-underline-offset: 0.2em;
}

.related {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

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

@media (min-width: 62rem) {
  .related:has(> :nth-child(5)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.related__item {
  display: grid;
  align-content: start;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  transition: border-color 0.2s;
}

.related__tiles {
  display: grid;
  grid-template-columns: repeat(3, 2.25rem);
  gap: 4px;
  margin-bottom: 0.5rem;
}

.related__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  font-stretch: 112%;
}

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

.other-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.points--large {
  max-width: 44rem;
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

.built {
  display: grid;
  gap: 0.75rem;
  max-width: 44rem;
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
  list-style: disc;
  color: var(--muted);
  font-size: 1.05rem;
}

.built li::marker {
  color: var(--dim);
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
}

.project__links .project__link {
  margin-top: 0;
}

.text-link {
  font-weight: 600;
  text-decoration-color: var(--c1);
  text-decoration-thickness: 2px;
}

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

.pager__link {
  display: grid;
  gap: 0.2rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  font-stretch: 112%;
  text-decoration: none;
}

.pager__link--next {
  text-align: right;
}

.pager__label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pager__link:hover {
  color: var(--mint);
}

.cta {
  margin-top: clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}

.cta__inner {
  display: grid;
  justify-items: start;
  gap: 1.25rem;
}

.cta__title {
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.cta__lead {
  max-width: var(--measure);
  color: var(--muted);
  font-size: var(--step-1);
}

.cta__email {
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4.6vw, 2.4rem);
  font-weight: 750;
  font-stretch: 110%;
  overflow-wrap: anywhere;
}

.cta__email a {
  text-decoration-color: var(--lilac);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.contact--page {
  padding-top: clamp(2rem, 5vw, 3.5rem);
}

.contact--page .points {
  margin-top: 1.25rem;
}

/* Contact page: the HeySales form beside the tips and the email address.
   The form draws its own card, coloured to match (set in HeySales). */
.contact__grid {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4.5rem);
  width: 100%;
  margin-top: clamp(2rem, 5vw, 3rem);
}

@media (min-width: 60rem) {
  .contact__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: start;
  }
}

.contact__form,
.contact__aside {
  min-width: 0;
}

.contact__subtitle {
  margin-bottom: 1.25rem;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}

.contact__subtitle--gap {
  margin-top: 2.5rem;
}

.contact--page .contact__aside .points {
  margin-top: 0;
  color: var(--muted);
}

.contact__email--aside {
  margin-top: 0;
  font-size: var(--step-2);
}

/* Footer navigation */

.footer-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-block: 2.5rem 1.5rem;
}

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

.footer-nav__title {
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-nav ul {
  display: grid;
  gap: 0.4rem;
}

.footer-nav a {
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-nav__email {
  margin-top: 0.75rem;
  overflow-wrap: anywhere;
}

.site-footer__legal {
  display: grid;
  gap: 0.5rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- 404 ---------- */

.not-found .wrap {
  display: grid;
  gap: 1.5rem;
  justify-items: start;
}

/* ---------- Small screens ---------- */

@media (max-width: 30rem) {
  .hero__actions .pill {
    flex: 1 1 100%;
  }
  .mosaic {
    max-width: 18rem;
  }
  .page-hero__tiles {
    max-width: 8rem;
  }
  .page-hero__tiles--six {
    max-width: 11rem;
  }
}

/* ---------- Reduced motion: nothing moves ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Forced colours (Windows high contrast) ---------- */

@media (forced-colors: active) {
  .tile {
    forced-color-adjust: none;
  }
  .mosaic,
  .project__cover,
  .footer-band,
  .wordmark__mark,
  .service__icon {
    display: none;
  }
  .service,
  .project,
  .pill,
  .project__link,
  .tags li {
    border: 1px solid CanvasText;
  }
}

/* ---------- Steps, FAQs, more links ---------- */

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

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

.step {
  position: relative;
  padding: 1.5rem 1.5rem 1.5rem 4.5rem;
  border-radius: 1.25rem;
  background: var(--surface);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  top: 1.35rem;
  left: 1.5rem;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--c1);
  color: var(--bg);
  font-family: var(--font-display);
  font-weight: 800;
}

.step__title {
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 750;
  font-stretch: 110%;
}

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

.faq {
  display: grid;
  gap: 0.75rem;
  max-width: 48rem;
}

.faq__item {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
}

.faq__q {
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 750;
  font-stretch: 108%;
}

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

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

.section-more {
  margin-top: 1.5rem;
}

/* ---------- Free tools ---------- */

.tool-form {
  display: grid;
  gap: 1.25rem;
  max-width: 40rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface);
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-weight: 600;
}

.field__hint {
  color: var(--muted);
  font-size: 0.9rem;
}

.field input {
  min-height: 3rem;
  padding: 0.7rem 1rem;
  border: 2px solid rgb(255 255 255 / 0.35);
  border-radius: 0.8rem;
  background: var(--bg);
  color: var(--paper);
  font: inherit;
  font-family: var(--font-mono);
}

.field input::placeholder {
  color: var(--dim);
}

.field input:focus-visible {
  border-color: var(--mint);
  outline-offset: 2px;
}

.tool-form button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.tool-status {
  min-height: 1.5rem;
  margin-top: 1.25rem;
  color: var(--muted);
}

.tool-results {
  display: grid;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.tool-results h2:focus {
  outline: none;
}

.tool-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tool-counts li,
.tool-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
}

.is-pass { --tone: var(--mint); }
.is-warn { --tone: var(--orange); }
.is-fail { --tone: var(--rose); }
.is-info { --tone: var(--blue); }

.tool-counts li {
  border: 1px solid var(--tone);
  color: var(--paper);
}

.tool-section__title {
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 750;
  font-stretch: 110%;
}

.tool-items {
  display: grid;
  gap: 0.6rem;
}

.tool-item {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--tone);
  border-radius: 0 1rem 1rem 0;
  background: var(--surface);
}

.tool-badge {
  justify-self: start;
  background: var(--tone);
  color: var(--bg);
}

.tool-item__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tool-item__detail {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tool-hops {
  padding-left: 1.25rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.tool-error {
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--rose);
  border-radius: 0 1rem 1rem 0;
  background: var(--surface);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tool-table caption {
  padding-bottom: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 750;
  text-align: left;
}

.tool-table th,
.tool-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.tool-table th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
}

.tool-table td:first-child {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

@media (max-width: 30rem) {
  .tool-item {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Articles ---------- */

.article-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

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

.article-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: var(--surface);
  transition: border-color 0.2s;
}

.article-card:hover {
  border-color: rgb(255 255 255 / 0.35);
}

.article-card__meta {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.article-card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  font-stretch: 110%;
  line-height: 1.2;
  text-wrap: balance;
}

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

.article__head {
  display: grid;
  gap: 1rem;
  padding-block: clamp(2rem, 6vw, 4rem) 1.5rem;
}

.article__head .kicker {
  margin-bottom: 0;
}

.article__title {
  max-width: 22ch;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.article__lead {
  max-width: 42rem;
  color: var(--muted);
  font-size: var(--step-1);
}

.article__body {
  max-width: 44rem;
  padding-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.7;
}

.article__body > * + * {
  margin-top: 1.1rem;
}

.article__body h2 {
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.2;
}

.article__body h3 {
  margin-top: 2rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 750;
}

.article__body ul,
.article__body ol {
  display: grid;
  gap: 0.5rem;
  padding-left: 1.4rem;
}

.article__body ul {
  list-style: disc;
}

.article__body ol {
  list-style: decimal;
}

.article__body li::marker {
  color: var(--lilac);
}

.article__body a {
  color: var(--mint);
}

.article__body code {
  padding: 0.1em 0.35em;
  border-radius: 0.35rem;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.article__body pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #080a14;
  line-height: 1.55;
}

.article__body pre code {
  padding: 0;
  background: none;
  font-size: 0.86rem;
  overflow-wrap: normal;
  white-space: pre;
}

/* ---------- Service groups ---------- */

.categories {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

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

@media (min-width: 46rem) and (max-width: 69.99rem) {
  .category:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 70rem) {
  .categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .category:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
  }
}

.category {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface);
}

.category__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.15;
}

.category__title a {
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 0.25);
}

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

.category__links {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.category__links a {
  display: inline-block;
  padding-block: 0.15rem;
  text-decoration-color: rgb(255 255 255 / 0.3);
}

.category__links a:hover {
  color: var(--mint);
}

.jump-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.jump-links a {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.jump-links a:hover {
  border-color: var(--paper);
}

.category-section {
  scroll-margin-top: 1rem;
}

.category-section__intro {
  margin: -0.75rem 0 1.5rem;
}

/* ---------- Screenshots ---------- */

.shot {
  position: relative;
  margin: 0;
}

.shot__browser {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface-2);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.8);
}

.shot__bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

.shot__bar span:not(.shot__url) {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.18);
}

.shot__url {
  margin-left: 0.6rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.shot__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.shot--with-phone {
  padding-right: 12%;
  padding-bottom: 8%;
}

.shot__phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26%;
  overflow: hidden;
  border: 6px solid #1b2033;
  border-radius: 1.4rem;
  background: #1b2033;
  box-shadow: 0 24px 50px -20px rgb(0 0 0 / 0.9);
}

.shot__phone .shot__img {
  border-radius: 1rem;
}

.page-hero .shot {
  width: 100%;
  max-width: 40rem;
  justify-self: end;
}

@media (min-width: 56rem) {
  .page-hero__grid:has(.shot) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }
}

.project__cover--shot {
  display: block;
  padding: clamp(1rem, 3vw, 1.75rem);
}

/* ---------- How it fits together ---------- */

.flow {
  margin: 0;
}

.flow__layers {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 62rem) {
  .flow__layers {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
  }
}

.flow__layer {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--c);
  border-radius: 1rem;
  background: var(--surface);
}

/* Arrow to the next layer: down on phones, right on wide screens. */
.flow__layer:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1.45rem;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--muted);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v16M6 14l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  translate: -50% 0;
}

@media (min-width: 62rem) {
  .flow__layer:not(:last-child)::after {
    left: auto;
    right: -1.6rem;
    bottom: auto;
    top: 50%;
    rotate: -90deg;
    translate: 0 -50%;
  }
}

.flow__name {
  color: var(--c);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flow__items {
  display: grid;
  gap: 0.45rem;
}

.flow__items li {
  padding: 0.5rem 0.7rem;
  border-radius: 0.6rem;
  background: var(--surface-2);
  font-size: 0.95rem;
  line-height: 1.4;
}

.flow__caption {
  max-width: 44rem;
  margin-top: 1.25rem;
  color: var(--muted);
}

/* ---------- Home: pillars, featured work, resources ---------- */

.pillars {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

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

.pillar {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.75rem;
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface);
  transition: border-color 0.2s;
}

.pillar:hover {
  border-color: rgb(255 255 255 / 0.35);
}

.pillar__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.15;
}

.pillar__title a {
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 0.25);
}

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

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

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

.featured__item {
  position: relative;
  display: grid;
  gap: 1rem;
}

.featured__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  font-stretch: 112%;
}

.featured__name a {
  text-decoration: underline;
  text-decoration-color: var(--c1);
  text-underline-offset: 0.2em;
}

.featured__item:hover .shot__browser {
  border-color: rgb(255 255 255 / 0.35);
}

.resources {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

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

.resources__col {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
}

.resources__title {
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  font-stretch: 112%;
}

.resources__list {
  display: grid;
  gap: 0.5rem;
}

.resources__list a {
  text-decoration-color: rgb(255 255 255 / 0.3);
}

.resources__list a:hover {
  color: var(--mint);
}

/* Titles beside a screenshot: smaller, and never wider than their column. */
.page-hero__title {
  justify-self: stretch;
}

.page-hero__grid:has(.shot) .page-hero__title {
  font-size: clamp(2rem, 3.6vw, 3rem);
}

/* Extra screens on a case study. */
.gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 56rem;
}

.gallery__item {
  margin: 0;
}

.gallery__item figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
}

/* Five items: three, then two, rather than one left alone. */
@media (min-width: 62rem) {
  .features:has(> :nth-child(5):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
