/* Reset and base. Act 2 is the real page, so these are its defaults. */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0; text-wrap: pretty; }

a { color: inherit; }

ul, ol { margin: 0; padding: 0; list-style: none; }

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

/* Headings take focus after the switch so screen readers announce them. They are
   not controls, so a ring around them only confuses sighted visitors. */
[tabindex="-1"]:focus { outline: none; }

/* Layout primitives */

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(var(--sp-6), 8vw, var(--sp-8)); position: relative; }
.section--tight { padding-block: var(--sp-7); }

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

.standfirst {
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--text-dim);
  max-width: 46ch;
}

.section-head { margin-bottom: var(--sp-6); }

/* Skip link. First focusable element on the page. */
.skip-link {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 2000;
  padding: 0.7rem 1.1rem;
  background: var(--text);
  color: var(--void);
  font-weight: 600;
  border-radius: var(--radius-sm);
  transform: translateY(calc(-100% - var(--sp-5)));
  transition: transform 0.18s var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

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

/* Buttons */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease-out), border-color 0.25s var(--ease-out),
    color 0.25s var(--ease-out);
}

/* display above would otherwise beat the hidden attribute. */
.btn[hidden] { display: none; }

.btn:hover { transform: translateY(-2px); border-color: transparent; }
.btn:active { transform: translateY(0); }

/* Hover is a quiet fill. The spectrum is kept for the hero word and the mark,
   so it still means something when it appears. */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--surface-2);
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
  z-index: -1;
}

.btn:hover::before { opacity: 1; }

/* Magenta is the one action colour. Near-black text on it is 5.8:1. */
.btn--primary {
  --btn-fg: var(--void);
  border-color: transparent;
  background: var(--magenta);
  font-weight: 700;
}

.btn--primary::before { background: var(--magenta-text); }

.btn--ghost { --btn-fg: var(--text-dim); }
.btn--ghost:hover { --btn-fg: var(--text); border-color: var(--hairline-strong); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

/* Site header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--void) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.site-header[data-stuck="true"] { border-bottom-color: var(--hairline); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 44px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name { font-size: var(--step-0); }
.brand__name span { color: var(--text-faint); font-weight: 500; }

.site-nav { display: flex; align-items: center; gap: var(--sp-1); }

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  font-size: var(--step--1);
  text-decoration: none;
  color: var(--text-dim);
  border-radius: 999px;
  transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface); }

.site-nav a.is-primary {
  color: var(--void);
  background: var(--magenta);
  font-weight: 650;
}

.site-nav a.is-primary:hover { background: var(--magenta-text); }

/* The menu button only exists on phones, and only once the script has wired it.
   Without the script the links simply wrap onto a second row. */
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .site-header__inner { flex-wrap: wrap; row-gap: 0; }
  .site-nav { flex-wrap: wrap; }

  .nav-ready .nav-toggle {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0 0.9rem;
    font: 500 var(--step--1) / 1 var(--font-body);
    color: var(--text);
    background: none;
    border: 1px solid var(--hairline-strong);
    border-radius: 999px;
    cursor: pointer;
  }

  .nav-toggle svg { width: 16px; height: 16px; }

  .nav-ready .site-nav a:not(.is-primary) { display: none; }

  .nav-ready .site-header[data-menu="open"] .site-nav {
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: var(--sp-2) var(--sp-3);
  }

  .nav-ready .site-header[data-menu="open"] .site-nav a:not(.is-primary) {
    display: flex;
    border-radius: var(--radius-sm);
    font-size: var(--step-0);
  }

  .nav-ready .site-header[data-menu="open"] .site-nav a.is-primary {
    justify-content: center;
    margin-top: var(--sp-2);
  }
}

/* The narrowest phones cannot fit the name, the menu and the call side by side.
   The hero carries its own "Book a call" right below, and the menu has one too. */
@media (max-width: 480px) {
  .nav-ready .site-header:not([data-menu="open"]) .site-nav { display: none; }
}

/* Site footer */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding-block: var(--sp-7) var(--sp-5);
  margin-top: var(--sp-8);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--sp-5);
  align-items: start;
}

@media (max-width: 760px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}

.site-footer h2 {
  font-family: var(--font-body);
  font-size: var(--step--1);
  letter-spacing: 0;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

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

.site-footer__blurb { color: var(--text-dim); max-width: 34ch; margin-top: var(--sp-3); }

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--hairline);
  font-size: var(--step--1);
  color: var(--text-faint);
}

/* The 1995 easter egg. Quiet until hovered. */
.replay-95 {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  background: none;
  border: 1px dashed var(--hairline-strong);
  color: var(--text-faint);
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.replay-95:hover { color: var(--amber-text); border-color: var(--amber); border-style: solid; }
