/* ═══════════════════════════════════════════════════════════════
   Design tokens
   ═══════════════════════════════════════════════════════════════ */
:root {
  --color-ink:        #111827;
  --color-paper:      #FAFAF7;
  --color-mute:       #6B7280;
  --color-rule:       #E5E7EB;
  --color-navy:       #1E3A5F;
  --color-navy-hover: #152C47;
  --color-section-alt: #F3F4F6;

  --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, Menlo, "Courier New", monospace;

  --sp-4:   4px;
  --sp-8:   8px;
  --sp-16:  16px;
  --sp-24:  24px;
  --sp-32:  32px;
  --sp-48:  48px;
  --sp-64:  64px;
  --sp-96:  96px;
  --sp-128: 128px;

  --radius:   4px;
  --max-page: 960px;
  --max-body: 680px;

  /* Converts any opaque logo fill to Mute (#6B7280):
     brightness(0) neutralises original colour to black,
     the remaining chain colourises to the target grey-blue. */
  --logo-filter: brightness(0) saturate(100%) invert(46%) sepia(9%)
                 saturate(474%) hue-rotate(175deg) brightness(96%) contrast(87%);
}


/* ═══════════════════════════════════════════════════════════════
   Reset
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 28px;
  font-weight: 400;
  color: var(--color-ink);
  background-color: var(--color-paper);
}

img {
  display: block;
}

ul, ol {
  list-style: none;
}


/* ═══════════════════════════════════════════════════════════════
   Focus
   ═══════════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--color-navy);
  outline-offset: 3px;
  border-radius: 2px;
}


/* ═══════════════════════════════════════════════════════════════
   Skip link
   ═══════════════════════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-16);
  z-index: 999;
  padding: var(--sp-8) var(--sp-16);
  background-color: var(--color-navy);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 150ms ease;
}

.skip-link:focus {
  top: var(--sp-16);
}


/* ═══════════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-rule);
}

.header-inner {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: var(--sp-16) var(--sp-24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
}

/* Small header CTA — use element+class selector to beat a:visited specificity */
a.btn-header-cta {
  display: inline-block;
  background-color: var(--color-navy);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  padding: var(--sp-16) var(--sp-24);
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background-color 200ms ease;
  margin-left: auto;
}

a.btn-header-cta:hover {
  background-color: var(--color-navy-hover);
  color: var(--color-paper);
}

a.btn-header-cta:visited {
  color: var(--color-paper);
}


/* ═══════════════════════════════════════════════════════════════
   Wordmark  (header link + footer span)
   ═══════════════════════════════════════════════════════════════ */
.wordmark {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 18px;
  color: var(--color-ink);
  text-decoration: none;
  letter-spacing: 0;
}

a.wordmark:hover,
a.wordmark:visited {
  color: var(--color-ink);
  text-decoration: none;
}


/* ═══════════════════════════════════════════════════════════════
   Container
   ═══════════════════════════════════════════════════════════════ */
.container {
  max-width: var(--max-page);
  margin: 0 auto;
  padding: 0 var(--sp-24);
}


/* ═══════════════════════════════════════════════════════════════
   Global typography
   ═══════════════════════════════════════════════════════════════ */
h2 {
  font-family: var(--font-body);
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--sp-24);
}

p {
  font-size: 16px;
  line-height: 28px;
  color: var(--color-ink);
}

p + p {
  margin-top: var(--sp-16);
}

strong {
  font-weight: 600;
}

a {
  color: var(--color-navy);
  text-decoration: underline;
}

a:hover {
  color: var(--color-navy-hover);
}

a:visited {
  color: var(--color-navy);
}


/* ═══════════════════════════════════════════════════════════════
   Sections  — shared vertical rhythm
   ═══════════════════════════════════════════════════════════════ */
section:not(.hero) {
  padding-top: var(--sp-48);
}

#contact {
  background-color: var(--color-section-alt);
  padding-bottom: var(--sp-48);
}



/* ═══════════════════════════════════════════════════════════════
   Hero
   ═══════════════════════════════════════════════════════════════ */
.hero {
  padding: var(--sp-48) var(--sp-24);
}

.hero-inner {
  max-width: var(--max-page);
  margin: 0 auto;
}


/* ═══════════════════════════════════════════════════════════════
   Ticker  (animated H1)
   ═══════════════════════════════════════════════════════════════ */
.ticker {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-ink);
  margin-bottom: var(--sp-24);
  max-width: var(--max-body);
  /* min-height is set by JS to prevent layout shift between frames */
}

/* Cursor blink — only when reduced motion is not requested */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .ticker-cursor {
    animation: cursor-blink 530ms step-end infinite;
  }
}

/* Cross-fade for completion text */
.ticker-completion {
  transition: opacity 300ms ease;
}

.ticker-completion.fading {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .ticker-completion {
    transition: none;
  }
}


/* ═══════════════════════════════════════════════════════════════
   Hero label
   ═══════════════════════════════════════════════════════════════ */
.hero-label {
  font-size: 14px;
  line-height: 24px;
  font-weight: 500;
  color: var(--color-navy);
  margin-bottom: var(--sp-16);
}

.hero-label::before {
  content: '• ';
}

/* Avatar — hidden on mobile */
.hero-avatar {
  display: none;
}

.avatar-img {
  display: block;
  width: 140%;
  height: auto;
  margin-left: -20%;
  mix-blend-mode: multiply;
}


/* ═══════════════════════════════════════════════════════════════
   Hero  — sub-headline, CTAs, disqualifier
   ═══════════════════════════════════════════════════════════════ */
.hero-sub {
  font-size: 18px;
  line-height: 28px;
  font-weight: 500;        /* Inter Medium — visually distinct from body */
  color: var(--color-ink);
  max-width: var(--max-body);
  margin-bottom: var(--sp-32);
}

.hero-ctas {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-8);
  margin-bottom: var(--sp-16);
}

.disqualifier {
  font-size: 14px;
  line-height: 24px;
  color: var(--color-mute);
  max-width: var(--max-body);
}


/* ═══════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-block;
  background-color: var(--color-navy);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  padding: var(--sp-16) var(--sp-24);
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background-color 200ms ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background-color: var(--color-navy-hover);
  color: var(--color-paper);
}

.btn-primary:visited {
  color: var(--color-paper);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--color-navy);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  padding: var(--sp-16) var(--sp-24);
  border-radius: var(--radius);
  border: 1px solid var(--color-navy);
  cursor: pointer;
  transition: background-color 200ms ease;
  white-space: nowrap;
}

.btn-secondary:hover {
  background-color: rgba(30, 58, 95, 0.07);
  color: var(--color-navy);
}

.btn-secondary:visited {
  color: var(--color-navy);
}


/* ═══════════════════════════════════════════════════════════════
   Logo strip
   ═══════════════════════════════════════════════════════════════ */
.logo-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-32) var(--sp-24);
  align-items: center;
  justify-items: center;
  margin-bottom: var(--sp-24);
}

.logo-strip li {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Base logo styles: scale to fit cell, cap height, maintain ratio */
.logo {
  max-height: 44px;
  max-width: 100%;
  width: auto;
  height: auto;
  filter: var(--logo-filter);
}

/* Halfords: narrow viewBox → give it more vertical presence */
.logo-halfords {
  max-height: 34px;
}

/* Superdry: wide viewBox, same treatment */
.logo-superdry {
  max-height: 34px;
}

/* Interflora: viewBox is 600×450 but content occupies the lower portion,
   so a larger max-height gives the logo visible rendering room. */
.logo-interflora {
  max-height: 87px;
}

/* Custom Gifts: AVIF with green bg + white text. brightness(0) would
   destroy the contrast. grayscale() desaturates green to grey while
   keeping white text visible. */
.logo-custom-gifts {
  filter: grayscale(1) brightness(1.2);
  max-height: 48px;
}


/* ═══════════════════════════════════════════════════════════════
   What actually drives performance
   ═══════════════════════════════════════════════════════════════ */
#what-i-do {
  border-top: 1px solid var(--color-rule);
}

.h-centered {
  text-align: center;
}

.h-centered::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background-color: var(--color-navy);
  border-radius: 2px;
  margin: var(--sp-16) auto 0;
}

.perf-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-16);
  margin-bottom: var(--sp-24);
}

.perf-card {
  border: 1px solid var(--color-rule);
  border-radius: var(--radius);
  padding: var(--sp-24);
}

.perf-card-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  color: var(--color-navy);
  margin-bottom: var(--sp-16);
}

.perf-card-num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-navy);
  line-height: 1;
}

.perf-card-title {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--sp-8);
}

.perf-subline {
  text-align: center;
  font-size: 16px;
  line-height: 28px;
  font-weight: 500;
  color: var(--color-navy);
}

.perf-subline + .perf-subline {
  margin-top: var(--sp-4);
}


/* ═══════════════════════════════════════════════════════════════
   The pattern I see most often
   ═══════════════════════════════════════════════════════════════ */
#the-pattern {
  background-color: var(--color-section-alt);
  padding-bottom: var(--sp-48);
  margin-top: var(--sp-48);
}

.pattern-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-24);
}

.pattern-col-label {
  font-size: 13px;
  line-height: 24px;
  font-weight: 600;
  color: var(--color-ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-8);
}

/* Numbered list */
.pattern-nums {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: pattern-num;
}

.pattern-nums li {
  font-size: 16px;
  line-height: 28px;
  color: var(--color-ink);
  padding-left: var(--sp-24);
  position: relative;
  counter-increment: pattern-num;
}

.pattern-nums li::before {
  content: counter(pattern-num) '.';
  position: absolute;
  left: 0;
  color: var(--color-navy);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Dash bullet list */
.pattern-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pattern-bullets li {
  font-size: 16px;
  line-height: 28px;
  color: var(--color-ink);
  padding-left: var(--sp-16);
  position: relative;
}

.pattern-bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-mute);
}

/* Tick list */
.pattern-ticks {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pattern-ticks li {
  font-size: 16px;
  line-height: 28px;
  color: var(--color-ink);
  padding-left: var(--sp-24);
  position: relative;
}

.pattern-ticks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-navy);
  font-weight: 600;
}


#where-ive-worked {
  padding-bottom: var(--sp-48);
}


/* ═══════════════════════════════════════════════════════════════
   How I work
   ═══════════════════════════════════════════════════════════════ */
#how-i-work {
  border-top: 1px solid var(--color-rule);
  padding-bottom: var(--sp-48);
}

.hiw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-32);
  position: relative;
  margin-bottom: var(--sp-32);
}

.hiw-col {
  display: flex;
  flex-direction: column;
}

.hiw-circle-wrap {
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-16);
}

.hiw-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-navy);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.hiw-phase {
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-mute);
  margin-bottom: var(--sp-4);
}

.hiw-col-heading {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--sp-16);
}

.hiw-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hiw-bullets li {
  font-size: 16px;
  line-height: 28px;
  color: var(--color-ink);
  padding-left: var(--sp-16);
  position: relative;
}

.hiw-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-navy);
}

.hiw-footer {
  text-align: center;
  font-size: 14px;
  line-height: 24px;
  color: var(--color-mute);
}


/* ═══════════════════════════════════════════════════════════════
   Scope
   ═══════════════════════════════════════════════════════════════ */
#scope {
  padding-top: 0;
  padding-bottom: var(--sp-48);
}

.scope-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-16);
}

.scope-card {
  background-color: var(--color-section-alt);
  border-radius: var(--radius);
  padding: var(--sp-32);
}

.scope-card-heading {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--sp-16);
}

.scope-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}

.scope-bullets li {
  font-size: 16px;
  line-height: 28px;
  color: var(--color-ink);
  padding-left: var(--sp-16);
  position: relative;
}

.scope-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-navy);
}


/* ═══════════════════════════════════════════════════════════════
   Contact
   ═══════════════════════════════════════════════════════════════ */

/* Mobile: heading centred (h-centered handles text-align; just keep bar centred) */
#contact h2 {
  margin-bottom: var(--sp-8);
}

#contact h2::after {
  margin-left: auto;
  margin-right: auto;
}

.contact-tagline {
  text-align: center;
  margin-bottom: var(--sp-16);
}

.contact-inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-32);
}

.contact-list li {
  font-size: 16px;
  line-height: 28px;
  text-align: center;
}

.contact-list li + li {
  margin-top: var(--sp-8);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  color: var(--color-navy);
  text-decoration: none;
}

.contact-link:hover {
  color: var(--color-navy-hover);
  text-decoration: underline;
}

.contact-link:visited {
  color: var(--color-navy);
}

.contact-link svg {
  flex-shrink: 0;
}

.contact-cta {
  align-self: center;
}


/* ═══════════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--color-rule);
  padding: var(--sp-16) 0;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.footer-brand {
  font-size: 13px;
  line-height: 20px;
  color: var(--color-ink);
}

.footer-brand .wordmark {
  font-size: 13px;
}

.footer-copy {
  font-size: 13px;
  line-height: 20px;
  color: var(--color-mute);
  margin-top: 0;
}


/* ═══════════════════════════════════════════════════════════════
   Desktop  (768px+)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {

  .site-footer .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  #where-ive-worked {
    padding-bottom: var(--sp-64);
  }

  /* How I work — 3-column timeline */
  #how-i-work {
    padding-bottom: var(--sp-48);
  }

  .hiw-circle-wrap {
    display: flex;
    justify-content: center;
  }

  .hiw-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0 var(--sp-32);
  }

  .hiw-grid::before {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(100% / 6);
    width: calc(100% * 2 / 3);
    border-top: 2px dashed var(--color-navy);
    opacity: 0.3;
    z-index: 0;
  }

  /* Scope — 2-column desktop */
  #scope {
    padding-top: 0;
    padding-bottom: var(--sp-64);
  }

  .scope-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-24);
    align-items: stretch;
  }

  .header-inner {
    padding: var(--sp-16) var(--sp-32);
  }

  .wordmark {
    font-size: 20px;
  }

  .container {
    padding: 0 var(--sp-32);
  }

  /* Hero */
  .hero {
    padding: var(--sp-48) var(--sp-32);
  }

  /* Hero two-column layout */
  .hero-inner {
    display: flex;
    align-items: center;
    gap: var(--sp-48);
  }

  .hero-content {
    flex: 1;
    min-width: 0;
  }

  .hero-avatar {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
  }

  /* Ticker */
  .ticker {
    font-size: 40px;
    line-height: 1.3;
    margin-bottom: var(--sp-32);
  }

  /* Section headings */
  h2 {
    font-size: 32px;
    line-height: 40px;
    margin-bottom: var(--sp-32);
  }

  /* Section rhythm */
  section:not(.hero) {
    padding-top: var(--sp-64);
  }

  #contact {
    padding-bottom: var(--sp-64);
  }

  /* Contact — desktop layout: body left, button right */
  .contact-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-48);
  }

  #contact h2 {
    text-align: left;
    margin-bottom: var(--sp-8);
  }

  #contact h2::after {
    margin-left: 0;
    margin-right: 0;
  }

  .contact-tagline {
    text-align: left;
  }

  .contact-list li {
    text-align: left;
  }

  .contact-cta {
    flex-shrink: 0;
    align-self: auto;
  }

  /* Hero CTAs side-by-side */
  .hero-ctas {
    flex-direction: row;
    align-items: center;
    gap: var(--sp-16);
  }

  /* Pattern section */
  #the-pattern {
    padding-bottom: var(--sp-64);
    margin-top: var(--sp-64);
  }

  /* 4 equal columns */
  .pattern-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    align-items: stretch;
  }

  .pattern-col {
    padding: 0 var(--sp-24);
  }

  .pattern-col:first-child {
    padding-left: 0;
  }

  .pattern-col:last-child {
    padding-right: 0;
  }

  .pattern-col + .pattern-col {
    border-left: 1px solid var(--color-rule);
  }

  /* Performance cards — 3-up at desktop */
  .perf-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-24);
    margin-bottom: var(--sp-32);
  }

  .perf-card {
    padding: var(--sp-32);
  }

  /* Logo strip: 3-up at tablet, 6-up at wide */
  .logo-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-48) var(--sp-32);
  }

  .logo {
    max-height: 48px;
  }

  .logo-halfords,
  .logo-superdry {
    max-height: 39px;
  }

  .logo-interflora {
    max-height: 87px;
  }

  .logo-custom-gifts {
    max-height: 53px;
  }
}

@media (min-width: 1024px) {
  .logo-strip {
    grid-template-columns: repeat(6, 1fr);
  }
}
