/* ==========================================================================
   1. Settings: colours, sizes and fonts
   ========================================================================== */

:root {
  /* Brand colours */
  --blue: #1e90ff;              /* Dodger blue: backgrounds, the logo and large headings only */
  --deep-blue: #0060c7;         /* Buttons and links. Safe for small text on white */
  --deep-blue-hover: #004fa6;
  --navy: #0b1a2b;              /* Main text colour, and text on blue backgrounds */
  --pale-blue: #d6e9ff;

  /* Neutrals */
  --page-background: #f4f8fc;
  --card-background: #ffffff;
  --muted-text: #5a6573;
  --placeholder-text: #6b7684;
  --border: #dce5ef;
  --input-border: #9fb1c4;

  /* Messages */
  --error: #b3261e;
  --success: #1d7a3d;

  /* Corners */
  --radius-small: 10px;
  --radius-medium: 16px;
  --radius-large: 28px;

  /* Space at the left and right of the page. Grows with the screen, between 16px and 48px */
  --page-gutter: clamp(16px, 4vw, 48px);
  --page-max-width: 1240px;

  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}


/* ==========================================================================
   2. Base: page defaults
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px; /* Stops the sticky header covering section headings when jumping to them */
}

body {
  margin: 0;
  background-color: var(--page-background);
  color: var(--navy);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a {
  color: var(--deep-blue);
}

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

h1,
h2 {
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

h2 {
  margin-bottom: 28px;
  font-size: clamp(2rem, 4.2vw, 3rem);
}

/* Keyboard focus ring, used on every link, button and field */
:focus-visible {
  outline: 3px solid var(--deep-blue);
  outline-offset: 3px;
  border-radius: 4px;
}


/* ==========================================================================
   3. Helpers
   ========================================================================== */

/* Makes the hidden attribute win over any display rule below */
[hidden] {
  display: none !important;
}

/* Hidden on screen but still read out by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* "Skip to content" link: off screen until it gets keyboard focus */
.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 30;
  padding: 10px 14px;
  background-color: var(--navy);
  color: #ffffff;
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

/* The logo file is white on a transparent background, so it's used as a mask
   and takes whatever background colour is set here. */
.logo {
  display: inline-block;
  background-color: var(--blue);
  -webkit-mask: url(assets/logo.png) center / contain no-repeat;
  mask: url(assets/logo.png) center / contain no-repeat;
}


/* ==========================================================================
   4. Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px var(--page-gutter);
  background-color: rgba(244, 248, 252, 0.95);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.brand .logo {
  width: 34px;
  height: 34px;
}

.site-header nav {
  display: flex;
  gap: clamp(4px, 2vw, 24px);
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  color: var(--navy);
  font-weight: 500;
  text-decoration: none;
}

.site-header nav a:hover {
  color: var(--deep-blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* ==========================================================================
   5. Buttons
   ========================================================================== */

/* Outline button */
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--navy);
  border-radius: var(--radius-small);
  background-color: transparent;
  color: var(--navy);
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

/* Filled blue button, for the main action in each area */
.button-primary {
  border-color: var(--deep-blue);
  background-color: var(--deep-blue);
  color: #ffffff;
}

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

/* Hover colours only on devices with a mouse or trackpad,
   so a tapped button on a phone doesn't stay stuck in its hover colour. */
@media (hover: hover) {
  .button:hover {
    background-color: var(--navy);
    color: #ffffff;
  }

  .button-primary:hover {
    border-color: var(--deep-blue-hover);
    background-color: var(--deep-blue-hover);
  }
}


/* ==========================================================================
   6. Sections
   ========================================================================== */

section {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) var(--page-gutter);
}


/* ==========================================================================
   7. Hero
   Text on the left, project stickers on the right. Stacks on smaller screens.
   ========================================================================== */

.hero {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hero-text {
  flex: 1.1 1 0;
}

.hero h1 {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
}

/* "apps" in the headline. Dodger blue only passes contrast at this large size. */
.hero h1 span {
  color: var(--blue);
}

.hero-intro {
  max-width: 42ch;
  margin-top: 20px;
  color: var(--muted-text);
  font-size: 1.2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

@media (min-width: 960px) {
  .hero {
    flex-direction: row;
    align-items: center;
  }
}


/* ==========================================================================
   8. Project stickers
   Each project icon looks like a die-cut sticker stuck on the page:
   white edge, soft shadow, and its own tilt and height.
   ========================================================================== */

.projects {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 26px;
  padding: 8px 6px 0;
}

.sticker-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

/* Each sticker is a button */
.sticker {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 6px 2px 4px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

/* Tilt, and how far down each sticker sits. --order sets when it appears in the load animation. */
.sticker:nth-child(1) {
  --tilt: -6deg;
  --order: 0;
}

.sticker:nth-child(2) {
  --tilt: 4deg;
  --order: 1;
  margin-top: 34px;
}

.sticker:nth-child(3) {
  --tilt: -3deg;
  --order: 2;
  margin-top: 6px;
}

.sticker:nth-child(4) {
  --tilt: 7deg;
  --order: 3;
  margin-top: 24px;
}

.sticker-image {
  width: clamp(64px, 7.5vw, 96px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 6px solid #ffffff;
  border-radius: 24%;
  background-color: #ffffff;
  box-shadow: 0 0 0 1px var(--border), 0 12px 22px -10px rgba(11, 26, 43, 0.45);
  transform: rotate(var(--tilt));
  transition: transform 0.2s ease-out;
}

/* For icons with a transparent background that need a dark backing */
.sticker-image-dark {
  background-color: var(--navy);
}

.sticker-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sticker b {
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.sticker:focus-visible {
  outline: 3px solid var(--deep-blue);
  outline-offset: 2px;
}

/* The selected sticker straightens up and grows slightly */
.sticker[aria-selected="true"] .sticker-image {
  transform: rotate(0) scale(1.1);
}

.sticker[aria-selected="true"] b {
  color: var(--deep-blue);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

@media (hover: hover) {
  .sticker:hover .sticker-image {
    transform: rotate(0) scale(1.05);
  }
}

/* When the hero stacks, there's room for full-size stickers */
@media (max-width: 959px) {
  .sticker-image {
    width: 96px;
  }
}


/* ==========================================================================
   9. Project details card
   Shows the selected project. The blue tail on top slides under the chosen
   sticker; script.js sets --tail-position.
   ========================================================================== */

.project-details {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 172px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius-medium);
  background-color: var(--card-background);
  box-shadow: 0 14px 30px -22px rgba(11, 26, 43, 0.5);
}

/* The tail: a small blue square turned 45 degrees */
.project-details::before {
  content: "";
  position: absolute;
  top: -13px;
  left: var(--tail-position, 12%);
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 3px 0 0 0;
  background-color: var(--blue);
  transform: rotate(45deg);
  transition: left 0.3s ease-out;
}

.project-status {
  color: var(--deep-blue);
  font-size: 0.8rem;
  font-weight: 700;
}

.project-details h3 {
  margin-top: 2px;
  font-size: 1.4rem;
}

.project-details p {
  margin-top: 4px;
  color: var(--muted-text);
}

.project-details a {
  display: inline-flex;
  align-self: flex-start;
  align-items: flex-end;
  min-height: 44px;
  margin-top: auto;
  padding-top: 8px;
  font-weight: 700;
}


/* ==========================================================================
   10. Services carousel
   A row that scrolls sideways and snaps to each card, so swiping and
   trackpads work without any extra code. script.js adds the buttons and autoplay.
   ========================================================================== */

.services-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 28px;
}

.services-header h2 {
  margin-bottom: 0;
}

.carousel-controls {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.carousel-button {
  width: 48px;
  height: 48px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background-color: var(--card-background);
  color: var(--navy);
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

@media (hover: hover) {
  .carousel-button:hover {
    background-color: var(--navy);
    color: #ffffff;
  }
}

.carousel-track {
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 4px 4px 20px;
  overflow-x: auto;
  list-style: none;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--input-border) transparent;
  scrollbar-width: thin;
}


/* ==========================================================================
   11. Service cards
   Three cards show at once on large screens, two on tablets, one on phones.
   Each card has its own colour, set by the colour variables below.
   ========================================================================== */

.service-card {
  display: flex;
  flex: 0 0 calc((100% - 32px) / 3); /* 3 cards, minus the two 16px gaps */
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background-color: var(--card-background);
  scroll-snap-align: start;
}

.service-card-top {
  /* Default colours (the blue card). Each colour class below swaps these. */
  --top-colour: var(--blue);
  --title-colour: #ffffff;
  --number-colour: var(--navy);
  --icon-colour: #ffffff;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-height: 150px;
  padding: 20px 22px 22px;
  background-color: var(--top-colour);
}

.service-card-navy .service-card-top {
  --top-colour: var(--navy);
  --number-colour: #8fc4ff;
  --icon-colour: var(--blue);
}

.service-card-pale .service-card-top {
  --top-colour: var(--pale-blue);
  --title-colour: var(--navy);
  --number-colour: #004a99;
  --icon-colour: var(--deep-blue);
}

.service-card-deep .service-card-top {
  --top-colour: var(--deep-blue);
  --number-colour: #d0e6ff;
}

.service-card-outline .service-card-top {
  --top-colour: #ffffff;
  --title-colour: var(--navy);
  --number-colour: var(--deep-blue);
  --icon-colour: var(--blue);
  border-bottom: 3px dashed var(--blue);
}

.service-card-sky .service-card-top {
  --title-colour: var(--navy);
  --icon-colour: var(--navy);
}

/* Number above, service name below */
.service-card-heading {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  gap: 16px;
}

.service-card-top span {
  color: var(--number-colour);
  font-weight: 700;
}

.service-card-top h3 {
  color: var(--title-colour);
  font-size: 1.6rem;
  line-height: 1.1;
}

.service-card-icon {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  color: var(--icon-colour);
  transition: transform 0.25s ease-out;
}

@media (hover: hover) {
  .service-card:hover .service-card-icon {
    transform: rotate(-6deg) scale(1.08);
  }
}

.service-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px 22px;
}

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

.service-card-body .button {
  align-self: flex-start;
  min-height: 44px;
  margin-top: auto;
  padding: 0 16px;
}

/* Tablets: 2 cards at once */
@media (max-width: 900px) {
  .service-card {
    flex-basis: calc((100% - 16px) / 2);
  }
}

/* Phones: 1 card, with the next one peeking in */
@media (max-width: 600px) {
  .service-card {
    flex-basis: 85%;
  }
}


/* ==========================================================================
   12. Client work
   Cards wrap onto new rows. A website card starts at half a row and an app
   card at a third, so two websites, or a website and an app, share a row.
   script.js builds the cards from the list in that file.
   ========================================================================== */

.work-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background-color: var(--card-background);
}

.work-card-website {
  flex: 2 1 calc(50% - 16px);
}

.work-card-app {
  flex: 1 1 calc(33.333% - 16px);
}

.work-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
}

.work-type {
  color: var(--deep-blue);
  font-size: 0.8rem;
  font-weight: 700;
}

.work-card h3 {
  font-size: 1.25rem;
}

.work-client {
  color: var(--muted-text);
  font-size: 0.95rem;
}

.work-card .button {
  align-self: flex-start;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 16px;
}

.work-empty-message {
  color: var(--muted-text);
}

/* Screenshots: wide for websites, tall and narrow for phone apps */
.screenshot {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: var(--page-background);
}

.screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.screenshot-website {
  aspect-ratio: 16 / 10;
}

.screenshot-app {
  width: min(100%, 230px);
  aspect-ratio: 9 / 19.5;
  margin: 0 auto;
  border-radius: 26px;
}

/* Shown when a project has no screenshot yet */
.screenshot-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  border: 2px dashed var(--input-border);
  color: var(--muted-text);
  font-size: 0.9rem;
  text-align: center;
}

/* Tablets: websites take a full row, apps sit two to a row */
@media (max-width: 960px) {
  .work-card-website {
    flex-basis: 100%;
  }

  .work-card-app {
    flex-basis: calc(50% - 16px);
  }
}

/* Phones: one card per row */
@media (max-width: 600px) {
  .work-card-website,
  .work-card-app {
    flex-basis: 100%;
  }
}


/* ==========================================================================
   13. Case study pop-up
   Opens from "More about this project". Screenshot on the left, details on the right.
   ========================================================================== */

.case-study {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-large);
  background-color: var(--card-background);
  color: var(--navy);
}

/* The dimmed page behind the pop-up */
.case-study::backdrop {
  background-color: rgba(11, 26, 43, 0.6);
}

.case-study-inner {
  position: relative;
  display: flex;
  gap: 28px;
  padding: 28px;
}

.case-study-screenshot {
  flex: 1.2 1 0;
  min-width: 0;
}

/* App screenshots are narrow, so they only take the space they need */
.case-study-app .case-study-screenshot {
  flex: 0 0 auto;
}

.case-study-screenshot .screenshot-app {
  width: 240px;
}

.case-study-body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 10px;
  padding-right: 36px; /* Room for the close button */
}

.case-study-body h3 {
  font-size: 1.8rem;
  line-height: 1.1;
}

.case-study-client {
  color: var(--muted-text);
}

.case-study-body h4 {
  margin-top: 8px;
  font-size: 1rem;
}

.case-study-body ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted-text);
}

.case-study-body .button {
  align-self: flex-start;
  margin-top: 12px;
}

.case-study-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background-color: var(--card-background);
  color: var(--navy);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.case-study-close:hover {
  background-color: var(--page-background);
}

/* Smaller screens: screenshot above the details */
@media (max-width: 720px) {
  .case-study-inner {
    flex-direction: column;
    padding: 64px 20px 20px;
  }

  .case-study-body {
    padding-right: 0;
  }
}


/* ==========================================================================
   14. Contact
   Intro on the left, form on the right. Stacks on smaller screens.
   ========================================================================== */

.contact {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.contact-intro h2 {
  margin-bottom: 16px;
}

.contact-intro p {
  max-width: 34ch;
  color: var(--muted-text);
  font-size: 1.15rem;
}

@media (min-width: 900px) {
  .contact {
    flex-direction: row;
    align-items: flex-start;
  }

  .contact-intro {
    flex: 1 1 0;
  }

  .contact-form {
    flex: 1.4 1 0;
  }
}


/* ==========================================================================
   15. Contact form
   ========================================================================== */

.contact-form {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: clamp(20px, 3.5vw, 32px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background-color: var(--card-background);
}

/* Each field takes a full row... */
.form-field {
  display: flex;
  flex: 1 1 100%;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ...except name and email, which share a row when there's room */
.form-field-half {
  flex: 1 1 220px;
}

label,
legend {
  padding: 0;
  font-weight: 700;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-small);
  background-color: #ffffff;
  color: var(--navy);
  font-family: inherit;
  font-size: inherit;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

::placeholder {
  color: var(--placeholder-text);
}

input:hover,
textarea:hover {
  border-color: var(--muted-text);
}

/* Fields that failed validation */
[aria-invalid="true"] {
  border-width: 2px;
  border-color: var(--error);
}

.field-error {
  color: var(--error);
  font-size: 0.92rem;
}

/* "What do you need?" options: checkboxes styled as toggle buttons */
.service-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.service-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-small);
  background-color: #ffffff;
  font-weight: 500;
  cursor: pointer;
}

/* The real checkbox stays in the page for keyboards and screen readers, just invisible */
.service-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.service-option:hover {
  border-color: var(--deep-blue);
}

.service-option:has(input:checked) {
  border-color: var(--deep-blue);
  background-color: var(--deep-blue);
  color: #ffffff;
}

/* Tick before the label when chosen */
.service-option:has(input:checked) span::before {
  content: "\2713\00a0";
}

.service-option:has(input:focus-visible) {
  outline: 3px solid var(--deep-blue);
  outline-offset: 2px;
}

/* Hidden field that only spam bots fill in */
.spam-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-footer {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.form-status {
  color: var(--muted-text);
}

.form-status-success {
  color: var(--success);
  font-weight: 700;
}

.form-status-error {
  color: var(--error);
  font-weight: 700;
}


/* ==========================================================================
   16. Footer
   ========================================================================== */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 32px var(--page-gutter) 40px;
  border-top: 1px solid var(--border);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer ul a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--navy);
  text-decoration: none;
}

.site-footer ul a:hover {
  color: var(--deep-blue);
  text-decoration: underline;
}

.site-footer p {
  color: var(--muted-text);
  font-size: 0.92rem;
}


/* ==========================================================================
   17. Small screens (phones, up to 480px wide)
   ========================================================================== */

@media (max-width: 480px) {
  .site-header nav a {
    padding: 0 4px;
  }

  .sticker-row {
    gap: 4px;
  }

  .sticker-image {
    width: 64px;
    border-width: 4px;
  }

  .sticker b {
    font-size: 0.78rem;
  }

  .sticker:nth-child(2) {
    margin-top: 22px;
  }

  .sticker:nth-child(4) {
    margin-top: 14px;
  }

  .services-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .case-study-screenshot .screenshot-app {
    width: 170px;
  }
}


/* ==========================================================================
   18. Animation
   Each one plays once; nothing loops. Visitors who ask their device for
   reduced motion get none of this, and no smooth scrolling.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* Stickers press onto the page one after another when it loads */
  .sticker-image {
    animation: stick-on 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) backwards;
    animation-delay: calc(var(--order) * 90ms + 200ms);
  }

  @keyframes stick-on {
    from {
      opacity: 0;
      transform: rotate(calc(var(--tilt) - 14deg)) scale(1.4);
      box-shadow: 0 24px 30px -10px rgba(11, 26, 43, 0.35);
    }
  }

  /* The project details slide in each time a different sticker is picked */
  .project-details.changing > * {
    animation: slide-in 0.35s ease-out backwards;
  }

  .project-details.changing > :nth-child(2) {
    animation-delay: 40ms;
  }

  .project-details.changing > :nth-child(3) {
    animation-delay: 80ms;
  }

  .project-details.changing > :nth-child(4) {
    animation-delay: 120ms;
  }

  @keyframes slide-in {
    from {
      opacity: 0;
      transform: translateX(14px);
    }
  }

  /* The services row and client work cards rise in once as they scroll into view.
     script.js adds "reveal" to them, then "revealed" when they come on screen. */
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    transition-delay: var(--delay, 0ms);
  }

  .reveal.revealed {
    opacity: 1;
    transform: none;
  }
}

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