:root {
  --paper: #f6f7fb;
  --paper-dark: #e6e9f3;
  --ink: #161a2b;
  --muted: #575c6e;
  --line: #d3d7e4;
  --accent: #2f47b5;
  --accent-soft: #dfe4fb;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Public Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow: 0 30px 60px -30px rgba(22, 26, 43, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: 24px;
}

/* Scroll progress */
.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  z-index: 60;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .3s, box-shadow .3s;
}
.site-header.scrolled {
  background: rgba(246, 247, 251, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}
.logo {
  font: 600 1.35rem var(--serif);
  color: var(--ink);
  text-decoration: none;
}
.logo span { color: var(--accent); }
.site-header nav {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .6);
  border: 1px solid var(--line);
}
.site-header nav a {
  position: relative;
  z-index: 1;
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color .3s;
}
.site-header nav a.active { color: #fff; }
.nav-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0;
  transition: left .45s var(--ease), width .45s var(--ease), opacity .3s;
}
.nav-cta {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  transition: background .25s, border-color .25s, color .25s;
}
.nav-cta:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 96px;
  min-height: calc(100svh - 72px);
}
.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4.4rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero h1 em,
.section-title em { font-style: italic; font-weight: 400; color: var(--accent); }
.contact .section-title em { color: #fff; }
.lede {
  max-width: 50ch;
  font-size: 1.15rem;
  color: var(--muted);
  margin: 28px 0 36px;
}
.hero-actions { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.signature {
  margin: 0;
  font: italic 400 1.05rem/1.3 var(--serif);
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.signature span { font: 400 0.85rem var(--sans); color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 15px 26px;
  border-radius: 999px;
  font-weight: 500;
  box-shadow: 0 10px 24px -10px rgba(47, 71, 181, .7);
  transition: transform .25s var(--ease), box-shadow .25s, background .25s;
}
.button span { transition: transform .25s var(--ease); }
.button:hover { color: #fff; background: #23389a; transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(47, 71, 181, .8); }
.button:hover span { transform: translateX(4px); }

/* Headline word reveal (words are wrapped by script.js) */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.split .w > span { display: inline-block; }
.js .split .w > span {
  transform: translateY(110%);
  animation: word-up .9s var(--ease) forwards;
  animation-delay: calc(var(--i) * 60ms + 150ms);
}
@keyframes word-up { to { transform: none; } }

/* Hero visual: two browser windows plus notifications */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 0.85;
  --mx: 0;
  --my: 0;
}
.hero-visual > * {
  position: absolute;
  translate: calc(var(--mx) * var(--depth, 20) * 1px) calc(var(--my) * var(--depth, 20) * 1px);
  transition: translate .6s var(--ease);
}
.win {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.win-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.win-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.win-bar { position: relative; }
.win-bar span {
  /* centred on the whole bar, not the space left after the dots */
  position: absolute;
  left: 50%;
  translate: -50% 0;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--paper);
  padding: 2px 12px;
  border-radius: 999px;
}
.win-a { width: 92%; top: 8%; left: 4%; rotate: -2deg; }
.js .win { animation: rise 1s var(--ease) both; }
.js .win-a { animation-delay: .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(60px) scale(.96); } }

.pop {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 18px 40px -18px rgba(22, 26, 43, .4);
  z-index: 2;
}
.pop .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pop .tick {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
}
.pop-a { bottom: 4%; left: -4%; }
.pop-b { top: 0; right: -2%; }
.js .pop { animation: pop-in .7s var(--ease) both, bob 6s ease-in-out infinite; }
.js .pop-a { animation-delay: 1.1s, 1.8s; }
.js .pop-b { animation-delay: 1.3s, 2.6s; }
@keyframes pop-in { from { opacity: 0; transform: translateY(20px) scale(.85); } }
@keyframes bob { 50% { transform: translateY(-10px); } }

/* Marquee */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: #fff;
  padding: 22px 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee span {
  display: inline-flex;
  align-items: center;
  font: 400 clamp(1.6rem, 3.6vw, 2.6rem) var(--serif);
  white-space: nowrap;
}
.marquee span.alt { color: var(--accent); font-style: italic; }
.marquee span::after {
  content: "";
  width: 12px;
  height: 12px;
  margin: 0 36px;
  border-radius: 50%;
  background: var(--accent);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections */
section { padding-top: 120px; padding-bottom: 120px; }
.section-title {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  letter-spacing: -0.015em;
  margin-bottom: 48px;
}

/* Scroll reveal */
.js [data-reveal] {
  opacity: 0;
  translate: 0 40px;
  transition: opacity .9s var(--ease), translate .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; translate: 0 0; }

/* Screenshots with scroll parallax + hover tilt */
.shot {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .4s var(--ease), box-shadow .4s;
}
/* Frame is a little shorter than the 4:3 screenshot, so it can drift up and down without cropping the sides */
.shot-view { aspect-ratio: 4 / 2.8; overflow: hidden; }
.shot img {
  display: block;
  width: 100%;
  height: auto;
  translate: 0 calc(var(--py, 0px) - 12px);
}
.shot:hover { box-shadow: 0 40px 70px -30px rgba(22, 26, 43, .55); }

/* Work */
.project {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
}
.project h3 { font-size: 2.4rem; }
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 16px 0 22px;
}
.tags li {
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.link-arrow { font-weight: 500; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease); }
.link-arrow:hover { color: var(--accent); background-size: 100% 1px; }
.link-arrow span { display: inline-block; transition: transform .25s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }
.testimonial {
  margin: 32px 0 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
}
.testimonial p { font: italic 400 1.25rem/1.5 var(--serif); margin: 0 0 8px; }
.testimonial cite { font-style: normal; font-size: 0.9rem; color: var(--muted); }
.testimonial.placeholder {
  border: 1px dashed var(--line);
  border-left: 3px solid var(--line);
  border-radius: 4px;
  padding: 18px 20px;
  color: var(--muted);
}

/* Services: rows light up with a soft tint and an accent bar on hover */
.service-list {
  list-style: none;
  counter-reset: svc;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.service-list li {
  counter-increment: svc;
  position: relative;
  display: grid;
  grid-template-columns: 80px minmax(200px, 340px) 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 34px 20px;
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  transition: background-color .2s ease-out;
}
/* Keep the scroll-in stagger, but hover reacts straight away */
.js .service-list li[data-reveal] {
  transition: opacity .9s var(--ease) var(--d, 0ms), translate .9s var(--ease) var(--d, 0ms), background-color .2s ease-out 0s;
}
.service-list li::before {
  content: counter(svc, decimal-leading-zero);
  font: italic 400 1.1rem var(--serif);
  color: var(--accent);
  transition: translate .25s var(--ease);
}
.service-list li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform .25s var(--ease);
}
.service-list h3 { font-size: clamp(1.4rem, 2.6vw, 2rem); transition: color .2s, translate .25s var(--ease); }
.service-list p { margin: 0; color: var(--muted); max-width: 52ch; }
.service-list li:focus-within { background: var(--accent-soft); }
.service-list li:focus-within::after { transform: scaleY(1); }
@media (hover: hover) {
  .service-list li:hover { background: var(--accent-soft); }
  .service-list li:hover::after { transform: scaleY(1); }
  .service-list li:hover::before,
  .service-list li:hover h3 { translate: 8px 0; }
  .service-list li:hover h3 { color: var(--accent); }
}

/* Process: line draws across as it comes into view */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-top: 40px;
}
.steps::before,
.steps::after {
  content: "";
  position: absolute;
  top: 19px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line);
}
.steps::after {
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.6s var(--ease) .3s;
}
.steps.is-in::after { transform: scaleX(1); }
.step { position: relative; }
.step-n {
  position: absolute;
  top: -40px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line);
  font: 600 1rem var(--serif);
  color: var(--muted);
  z-index: 1;
  transition: background .4s, border-color .4s, color .4s;
}
.steps.is-in .step-n { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps.is-in .step:nth-child(1) .step-n { transition-delay: .3s; }
.steps.is-in .step:nth-child(2) .step-n { transition-delay: .8s; }
.steps.is-in .step:nth-child(3) .step-n { transition-delay: 1.3s; }
.steps.is-in .step:nth-child(4) .step-n { transition-delay: 1.8s; }
.step h3 { font-size: 1.3rem; margin: 30px 0 8px; }
.step p { margin: 0; color: var(--muted); }

/* Contact: the one block of solid colour */
.contact {
  background: var(--accent);
  color: #fff;
  padding-bottom: 140px;
}
.contact .section-title { color: #fff; }
/* Links in the blue block stay white so they don't vanish into the background */
.contact a:not(.email) { color: #fff; text-decoration-thickness: 1px; }
.contact a:not(.email):hover { color: var(--accent-soft); }
.contact-lead { max-width: 52ch; font-size: 1.2rem; margin: -24px 0 40px; color: rgba(255, 255, 255, .85); }
.email {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font: 600 clamp(1.6rem, 6vw, 4.4rem)/1.1 var(--serif);
  color: #fff;
  text-decoration: none;
  word-break: break-word;
  background: linear-gradient(#fff, #fff) 0 100% / 100% 3px no-repeat;
  padding-bottom: 6px;
  transition: background-size .5s var(--ease);
}
.email span { transition: transform .35s var(--ease); }
.email:hover { color: #fff; background-size: 0 3px; background-position: 100% 100%; }
.email:hover span { transform: translateX(10px) rotate(-45deg); }

/* Footer */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 32px;
  font-size: 0.88rem;
  color: var(--muted);
}
.site-footer p { margin: 0; }

/* Tablet */
@media (max-width: 940px) {
  .site-header nav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 40px; }
  .hero-visual { max-width: 560px; width: 100%; margin: 0 auto; }
  .project { grid-template-columns: 1fr; gap: 40px; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 72px; }
  .steps::before, .steps::after { display: none; }
  .service-list li { grid-template-columns: 56px 1fr; }
  .service-list li p { grid-column: 2; }
}

/* Phone */
@media (max-width: 600px) {
  .wrap { padding-inline: 16px; }
  .hero { padding-top: 32px; padding-bottom: 64px; }
  section { padding-top: 80px; padding-bottom: 80px; }
  .section-title { margin-bottom: 32px; }
  .pop { font-size: 0.75rem; padding: 8px 12px; }
  .pop-a { left: 0; }
  .pop-b { right: 0; }
  .pop-c { left: 2%; bottom: -6%; }
  .pop-d { right: 2%; }
  .service-list li { grid-template-columns: 40px 1fr; padding: 26px 12px; }
  .steps { grid-template-columns: 1fr; }
  .contact { padding-bottom: 100px; }
  .site-footer { flex-direction: column; gap: 4px; }
}

/* Respect people who've asked for less motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; translate: none; }
  .js .split .w > span { transform: none; }
}
