/* ==========================================================================
   AGENCY SITE — FULL STYLESHEET
   Option 4: "Modern, odd"
   Bricolage Grotesque (display) + Instrument Sans (body) + IBM Plex Mono (data)

   A complete base stylesheet: tokens, reset, every base element, layout
   primitives, and the components a marketing site actually needs.

   USAGE
   Import once, before any other stylesheet:
       (import this file before any other stylesheet)
   Nothing else should redefine :root tokens. Component overrides go in a
   separate file loaded after this one.

   PRODUCTION
   The @import below is render-blocking. Before launch, self-host:
       npm i @fontsource-variable/bricolage-grotesque
       npm i @fontsource/instrument-sans @fontsource/ibm-plex-mono
   then delete the @import and import those packages in your entry file.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,200..800&family=Instrument+Sans:ital,wght@0,400..700;1,400..700&family=IBM+Plex+Mono:wght@400;500&display=swap');


/* ==========================================================================
   1. TOKENS
   ========================================================================== */

:root {

  /* ---- Colour ---------------------------------------------------------
     Active palette: near-black / white / acid lime. This is the one that
     suits Bricolage — both are doing "modern and slightly odd".
     To switch palettes, replace this block only. Nothing below hardcodes
     a colour value.                                                       */

  --color-page:        #fafafa;   /* page background                       */
  --color-surface:     #ffffff;   /* cards, panels, raised things          */
  --color-surface-alt: #f2f2f0;   /* alternating band, form fields         */
  --color-ink:         #0d0d0d;   /* headings, primary text                */
  --color-ink-soft:    #2a2a2a;   /* body text                             */
  --color-muted:       #6e6e6e;   /* captions, labels, secondary           */
  --color-line:        #e4e4e2;   /* hairlines, dividers, borders          */
  --color-line-strong: #c8c8c4;   /* input borders, emphasised dividers    */

  --color-accent:       #c6f135;  /* CTAs only. Nothing else.              */
  --color-accent-hover: #b4e01f;
  --color-accent-ink:   #0d0d0d;  /* text sitting on the accent            */

  --color-inverse-bg:  #0d0d0d;   /* dark bands: hero, footer, CTA block   */
  --color-inverse-ink: #fafafa;
  --color-inverse-muted: #9a9a96;
  --color-inverse-line:  #2e2e2c;

  --color-success: #2f7d4f;
  --color-danger:  #b3341f;

  /* ---- Alternative palettes -------------------------------------------
     Uncomment one block, comment the one above.

     Ink / bone / signal orange:
       --color-page: #f5f2e9; --color-surface: #fffdf7;
       --color-surface-alt: #ece8dc; --color-ink: #16150f;
       --color-ink-soft: #2f2d24; --color-muted: #7a776d;
       --color-line: #ddd8c9; --color-line-strong: #c4bfae;
       --color-accent: #e85d24; --color-accent-hover: #cf4b16;
       --color-accent-ink: #fffdf7; --color-inverse-bg: #16150f;
       --color-inverse-ink: #f5f2e9; --color-inverse-muted: #8e8a7c;
       --color-inverse-line: #33322a;

     Navy / white / electric blue:
       --color-page: #ffffff; --color-surface: #ffffff;
       --color-surface-alt: #e8edf3; --color-ink: #0b1f3a;
       --color-ink-soft: #23364f; --color-muted: #64748b;
       --color-line: #dde3ea; --color-line-strong: #bcc6d2;
       --color-accent: #1e8fff; --color-accent-hover: #0d75d9;
       --color-accent-ink: #ffffff; --color-inverse-bg: #0b1f3a;
       --color-inverse-ink: #ffffff; --color-inverse-muted: #8fa2b8;
       --color-inverse-line: #1d3552;                                      */

  /* ---- Families -------------------------------------------------------- */

  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ---- Variable axes ---------------------------------------------------
     Bricolage carries opsz (12-96), wdth (75-100) and wght (200-800).
     Narrowing the width at display sizes is where its character lives.    */

  --opsz-display: 96;
  --opsz-heading: 48;
  --wdth-display: 88;   /* slightly condensed headlines                    */
  --wdth-body: 100;

  /* ---- Weights --------------------------------------------------------- */

  --fw-display: 700;
  --fw-body: 400;
  --fw-medium: 500;
  --fw-bold: 600;

  /* ---- Type scale ------------------------------------------------------
     Fluid mobile -> desktop. Seven steps total. Resist adding more.       */

  --fs-display: clamp(2.75rem, 5.5vw + 1rem, 5.25rem);      /* 44 -> 84px  */
  --fs-h2:      clamp(2rem, 2.8vw + 0.75rem, 3.25rem);      /* 32 -> 52px  */
  --fs-h3:      clamp(1.5rem, 1.2vw + 1rem, 1.875rem);      /* 24 -> 30px  */
  --fs-h4:      1.25rem;                                     /* 20px       */
  --fs-lede:    1.25rem;                                     /* 20px       */
  --fs-body:    1.0625rem;                                   /* 17px       */
  --fs-small:   0.9375rem;                                   /* 15px       */
  --fs-caption: 0.75rem;                                     /* 12px       */

  /* ---- Line height ----------------------------------------------------- */

  --lh-display: 0.98;
  --lh-heading: 1.12;
  --lh-lede: 1.45;
  --lh-body: 1.65;
  --lh-tight: 1.25;

  /* ---- Tracking -------------------------------------------------------- */

  --ls-display: -0.03em;
  --ls-heading: -0.02em;
  --ls-body: 0;
  --ls-caption: 0.09em;

  /* ---- Measure --------------------------------------------------------- */

  --measure: 68ch;
  --measure-narrow: 46ch;
  --measure-wide: 80ch;

  /* ---- Space ----------------------------------------------------------- */

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  --section-y: clamp(4rem, 8vw, 8rem);

  /* ---- Layout ---------------------------------------------------------- */

  --container: 1180px;
  --container-narrow: 760px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  /* ---- Border and radius ----------------------------------------------- */

  --radius: 6px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --border: 1px solid var(--color-line);
  --border-strong: 1px solid var(--color-line-strong);

  /* ---- Motion ---------------------------------------------------------- */

  --dur-fast: 120ms;
  --dur-base: 200ms;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
}


/* ==========================================================================
   2. RESET
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-8);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--color-ink-soft);
  background: var(--color-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: none; padding: 0; cursor: pointer; }

ul[class], ol[class] { list-style: none; padding: 0; }


/* ==========================================================================
   3. BASE ELEMENTS
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-variation-settings: "opsz" var(--opsz-heading), "wdth" var(--wdth-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--color-ink);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-display);
  font-variation-settings: "opsz" var(--opsz-display), "wdth" var(--wdth-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  max-width: var(--measure-narrow);
}

h2 { font-size: var(--fs-h2); max-width: var(--measure-narrow); }
h3 { font-size: var(--fs-h3); }

h4, h5, h6 {
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: var(--fw-bold);
  font-variation-settings: normal;
  letter-spacing: 0;
  line-height: var(--lh-tight);
}

h5, h6 { font-size: var(--fs-body); }

p { max-width: var(--measure); text-wrap: pretty; }

/* Vertical rhythm is applied by flow, not by per-element margins. This
   avoids the margin-collapse fights that come from setting them directly. */
.flow > * + * { margin-top: var(--space-4); }
.flow > * + h2 { margin-top: var(--space-7); }
.flow > * + h3 { margin-top: var(--space-6); }
.flow > h2 + *, .flow > h3 + * { margin-top: var(--space-3); }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: opacity var(--dur-fast) var(--ease);
}

a:hover { opacity: 0.7; }

strong, b { font-weight: var(--fw-bold); color: var(--color-ink); }

em, i { font-style: italic; }

small { font-size: var(--fs-small); }

ul, ol { padding-left: 1.25em; max-width: var(--measure); }

li + li { margin-top: var(--space-2); }

li::marker { color: var(--color-muted); }

blockquote {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 96, "wdth" 92;
  font-size: clamp(1.5rem, 2vw + 1rem, 2.25rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  max-width: var(--measure-narrow);
  padding-left: var(--space-5);
  border-left: 3px solid var(--color-accent);
  border-radius: 0;
}

blockquote cite {
  display: block;
  margin-top: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-style: normal;
  font-weight: var(--fw-medium);
  letter-spacing: 0;
  color: var(--color-muted);
}

hr {
  border: none;
  border-top: var(--border);
  margin: var(--space-7) 0;
}

code, kbd, samp, pre {
  font-family: var(--font-data);
  font-size: 0.9em;
}

code {
  background: var(--color-surface-alt);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

pre {
  background: var(--color-inverse-bg);
  color: var(--color-inverse-ink);
  padding: var(--space-5);
  border-radius: var(--radius);
  overflow-x: auto;
}

pre code { background: none; padding: 0; }

figure { margin: 0; }

figcaption {
  margin-top: var(--space-3);
  font-size: var(--fs-small);
  color: var(--color-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}

th {
  font-family: var(--font-data);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  text-align: left;
  color: var(--color-muted);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-strong);
}

td {
  padding: var(--space-4);
  border-bottom: var(--border);
}

::selection {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}


/* ==========================================================================
   4. LAYOUT
   ========================================================================== */

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

.container-narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }

.section-alt { background: var(--color-surface-alt); }

/* Dark band. Rewires the tokens rather than overriding every child rule,
   so anything dropped inside inherits correct colours automatically.      */
.section-dark {
  background: var(--color-inverse-bg);
  --color-ink: var(--color-inverse-ink);
  --color-ink-soft: var(--color-inverse-ink);
  --color-muted: var(--color-inverse-muted);
  --color-line: var(--color-inverse-line);
  --color-line-strong: var(--color-inverse-line);
  --color-surface: #191917;
  --color-surface-alt: #191917;
  color: var(--color-inverse-ink);
}

.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }

.split {
  display: grid;
  gap: var(--space-7);
  align-items: start;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .split-lead { grid-template-columns: 5fr 6fr; }
}

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }


/* ==========================================================================
   5. TYPE UTILITIES
   ========================================================================== */

/* Section eyebrow. Mono, tracked caps. Sits above an h2, never alone.     */
.eyebrow {
  display: block;
  font-family: var(--font-data);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--color-muted);
  margin-bottom: var(--space-3);
}

/* Sub-headline under the h1. One per page.                                */
.lede {
  font-size: var(--fs-lede);
  line-height: var(--lh-lede);
  color: var(--color-muted);
  max-width: var(--measure);
}

.label {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
}

.muted { color: var(--color-muted); }
.tabular { font-variant-numeric: tabular-nums; }
.measure-narrow { max-width: var(--measure-narrow); }
.measure-wide { max-width: var(--measure-wide); }


/* ==========================================================================
   6. HEADER AND NAV
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-page) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 68px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 24, "wdth" 88;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  text-decoration: none;
}

.nav { display: flex; align-items: center; gap: var(--space-5); }

.nav a {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
  color: var(--color-ink-soft);
}

.nav a[aria-current="page"] { color: var(--color-ink); }

@media (max-width: 780px) {
  .nav { display: none; }
  .nav[data-open="true"] {
    display: flex;
    position: absolute;
    inset: 68px 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5) var(--gutter) var(--space-6);
    background: var(--color-page);
    border-bottom: var(--border);
  }
}


/* ==========================================================================
   7. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 46px;
  padding: 0 var(--space-5);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease);
}

.btn:hover { opacity: 1; }
.btn:active { transform: translateY(1px); }

/* The only accent-filled element on the page. One per view.               */
.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
}

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

.btn-secondary {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-line-strong);
}

.btn-secondary:hover { border-color: var(--color-ink); }

.btn-ghost {
  background: transparent;
  color: var(--color-ink);
  padding-inline: var(--space-2);
}

.btn-ghost:hover { background: var(--color-surface-alt); }

.btn-lg { min-height: 54px; padding-inline: var(--space-6); font-size: var(--fs-body); }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}


/* ==========================================================================
   8. CARDS, STATS, BADGES
   ========================================================================== */

.card {
  background: var(--color-surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card-link {
  display: block;
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease);
}

.card-link:hover { opacity: 1; border-color: var(--color-line-strong); }

.card h3 { margin-bottom: var(--space-3); }

/* Result figures — £2.2m, 4.7x ROAS, 312%. Mono keeps the digits aligned. */
.stat {
  font-family: var(--font-data);
  font-size: clamp(2.25rem, 3.5vw + 1rem, 3.5rem);
  font-weight: var(--fw-medium);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--color-ink);
}

.stat-label {
  margin-top: var(--space-3);
  font-size: var(--fs-small);
  line-height: var(--lh-tight);
  color: var(--color-muted);
  max-width: 24ch;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.7em;
  font-family: var(--font-data);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
  border: var(--border-strong);
  border-radius: var(--radius-pill);
}

/* Client logo strip. Greyed until hover so it never fights the headline.  */
.logo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-6);
}

.logo-strip img {
  height: 26px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.55;
  transition: opacity var(--dur-base) var(--ease);
}

.logo-strip img:hover { opacity: 1; }


/* ==========================================================================
   9. FORMS
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: var(--space-2); }

.field label {
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--color-ink);
}

.field .hint { font-size: var(--fs-small); color: var(--color-muted); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-body);
  color: var(--color-ink);
  background: var(--color-surface);
  border: var(--border-strong);
  border-radius: var(--radius);
  transition: border-color var(--dur-fast) var(--ease);
}

textarea { min-height: 140px; resize: vertical; line-height: var(--lh-body); }

input:hover, select:hover, textarea:hover { border-color: var(--color-ink); }

::placeholder { color: var(--color-muted); opacity: 1; }

input[aria-invalid="true"], textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.field .error {
  font-size: var(--fs-small);
  color: var(--color-danger);
}

fieldset { border: none; padding: 0; }

legend {
  padding: 0;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--color-ink);
}


/* ==========================================================================
   10. FOOTER
   ========================================================================== */

.site-footer {
  background: var(--color-inverse-bg);
  --color-ink: var(--color-inverse-ink);
  --color-ink-soft: var(--color-inverse-ink);
  --color-muted: var(--color-inverse-muted);
  --color-line: var(--color-inverse-line);
  color: var(--color-inverse-ink);
  padding-block: var(--space-8) var(--space-6);
}

.site-footer a { text-decoration: none; font-size: var(--fs-small); }

.footer-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  padding-bottom: var(--space-7);
  border-bottom: 1px solid var(--color-inverse-line);
}

.footer-heading {
  font-family: var(--font-data);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  color: var(--color-inverse-muted);
  margin-bottom: var(--space-4);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-5);
  font-size: var(--fs-small);
  color: var(--color-inverse-muted);
}


/* ==========================================================================
   11. ACCESSIBILITY
   ========================================================================== */

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

.section-dark :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--color-accent);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  background: var(--color-ink);
  color: var(--color-page);
  border-radius: var(--radius);
  text-decoration: none;
  transition: top var(--dur-base) var(--ease);
}

.skip-link:focus { top: var(--space-4); opacity: 1; }

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

@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;
  }
}


/* ==========================================================================
   12. PRINT
   ========================================================================== */

@media print {
  .site-header, .site-footer, .btn { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
