*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0}
img,svg{max-width:100%}
/* Direction C, "quiet consultancy": one typeface, lots of white space, a single accent colour */
:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --fg: #1A1D1F;
  --muted: #5F676D;
  --rule: #E3E5E3;
  --accent: #1F5F5B;
  --accent-soft: #E6F0EE;
  --accent-fg: #FFFFFF;
  --ph-bg: #F1F1EC;
  --ph-border: #C9CCC6;
  --font: "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416; --surface: #1A1D20; --fg: #E8EAEB; --muted: #9AA2A8; --rule: #2A2E32;
    --accent: #7CC4BC; --accent-soft: #1B2B29; --accent-fg: #0E1A19; --ph-bg: #1E2226; --ph-border: #3C4248;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121416; --surface: #1A1D20; --fg: #E8EAEB; --muted: #9AA2A8; --rule: #2A2E32;
  --accent: #7CC4BC; --accent-soft: #1B2B29; --accent-fg: #0E1A19; --ph-bg: #1E2226; --ph-border: #3C4248;
  color-scheme: dark;
}

body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 17px; line-height: 1.65; }
.wrap { max-width: 1040px; margin: 0 auto; padding-inline: 32px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } body { font-size: 16px; } .card { padding: 22px; } }

a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
p { margin: 0; max-width: 64ch; }

/* Placeholders: clearly marked text for Sam to replace with real content */
.ph { background: var(--ph-bg); border: 1px dashed var(--ph-border); border-radius: 4px; padding: 0 .3em; color: var(--muted); -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* Top bar */
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: 28px; }
.brand { font-weight: 600; font-size: 16px; color: var(--fg); text-decoration: none; letter-spacing: -.01em; }
.top nav { display: flex; gap: 24px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--fg); }
@media (max-width: 600px) { .top nav { gap: 16px; } .top nav a.wide { display: none; } }

/* Hero */
.hero { padding-block: clamp(72px, 14vw, 160px) clamp(48px, 7vw, 72px); display: grid; gap: 28px; justify-items: start; }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--muted); margin: 0; }
@media (max-width: 600px) { .eyebrow span { display: block; } .eyebrow .sep { display: none; } }
.hero h1 { font-weight: 600; font-size: clamp(36px, 6.2vw, 64px); line-height: 1.08; letter-spacing: -.03em; margin: 0; max-width: 16ch; text-wrap: balance; }
.hero p.sub { font-size: clamp(18px, 2.2vw, 20px); color: var(--muted); max-width: 48ch; margin: 0; }
.btn { display: inline-block; font: 500 16px var(--font); background: var(--accent); color: var(--accent-fg); padding: 13px 24px; border-radius: 999px; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--rule); }
.btn.ghost:hover { border-color: var(--muted); filter: none; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.avail { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.avail::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* Sections */
section { padding-block: clamp(56px, 9vw, 96px); border-top: 1px solid var(--rule); }
.sec-head { display: grid; gap: 10px; align-content: start; margin-bottom: 40px; }
.sec-head h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin: 0; }
.sec-head p { color: var(--muted); margin: 0; max-width: 56ch; }
.sec-head.flush { margin: 0; }
.more { font-size: 15px; font-weight: 500; text-decoration: none; }
.more::after { content: " →"; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.cards.pairs { grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 28px; display: grid; gap: 10px; align-content: start; }
.card h3 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: -.01em; line-height: 1.3; }
.card p { color: var(--muted); font-size: 15.5px; }
.card:has(> .more) { display: flex; flex-direction: column; }
.card .more { margin-top: auto; padding-top: 6px; }
a.card { color: inherit; text-decoration: none; transition: border-color .15s; }
a.card:hover { border-color: var(--accent); }
a.card:hover h3 { color: var(--accent); }
.card .meta { font-size: 13.5px; color: var(--muted); font-weight: 500; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li { font-size: 12.5px; font-weight: 500; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }

/* Two-column sections */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px 64px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.two .body { display: grid; gap: 18px; align-content: start; }
.subhead { font-size: 16px; font-weight: 600; margin: 14px 0 0; }

/* Experience list */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: grid; justify-items: start; gap: 6px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.list > li:first-child { border-top: 1px solid var(--rule); }
.list .k { font-weight: 600; }
.list .desc { color: var(--muted); font-size: 15px; max-width: 60ch; }
.roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.roles li { display: grid; }
.roles .t { font-size: 15.5px; }
.roles .d { color: var(--muted); font-size: 14px; }
/* Several roles at one company: a thin timeline joining them */
.roles.multi { border-left: 2px solid var(--rule); padding-left: 16px; margin-left: 4px; }
.roles.multi li { position: relative; }
.roles.multi li::before { content: ""; position: absolute; left: -22px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
.roles.multi li:first-child::before { border-color: var(--accent); background: var(--accent); }
.areas { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.areas li { border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; padding: 7px 16px; font-size: 15px; }

/* Company logos: original colours on a white tile, so they read in dark mode too */
.logo { display: inline-grid; place-items: center; flex: none; background: #FFFFFF; border: 1px solid var(--rule); border-radius: 10px; width: 132px; height: 56px; padding: 10px 16px; }
.logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.logo.tall img { max-height: 40px; }
.logo.sm { width: 96px; height: 38px; padding: 6px 10px; border-radius: 8px; }
.logo.sm.tall img { max-height: 30px; }
.logos { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 600px) { .logos .logo:not(.sm) { width: calc(50% - 6px); } }

/* Employer strip under the hero */
.employers { display: grid; gap: 14px; padding-bottom: clamp(56px, 9vw, 96px); }
.employers .label { font-size: 14px; font-weight: 500; color: var(--muted); margin: 0; }

/* "Quoted by" strip */
.quoted .logo { width: 140px; }
@media (max-width: 600px) { .quoted .logo { width: calc(50% - 6px); } }
.fine { font-size: 13.5px; color: var(--muted); }

/* Company name with logo (Experience) and logo in card meta lines */
.list .co { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.card > .logo { justify-self: start; margin-bottom: 4px; }

/* Contact */
.contact { display: grid; gap: 22px; }
.contact-line { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.email { font-size: clamp(20px, 3.4vw, 30px); font-weight: 600; letter-spacing: -.02em; color: var(--fg); text-decoration: none; border-bottom: 2px solid var(--accent); word-break: break-all; }
.email:hover { color: var(--accent); }
.copy { font: 500 14px var(--font); background: var(--surface); color: var(--fg); border: 1px solid var(--rule); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.copy:hover { border-color: var(--muted); }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-block: 28px 40px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--fg); }

/* Inner pages */
.page-head { padding-block: clamp(48px, 9vw, 104px) clamp(40px, 6vw, 64px); display: grid; gap: 18px; justify-items: start; }
.page-head h1 { font-weight: 600; font-size: clamp(32px, 5vw, 50px); line-height: 1.1; letter-spacing: -.03em; margin: 0; max-width: 22ch; text-wrap: balance; }
.page-head .lede { font-size: clamp(17px, 2vw, 19px); color: var(--muted); max-width: 58ch; }
.crumb { font-size: 14px; font-weight: 500; text-decoration: none; }
.crumb::before { content: "← "; }

/* Work index filters */
.filters[hidden] { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { font: 500 14px var(--font); background: var(--surface); color: var(--fg); border: 1px solid var(--rule); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.work-grid [hidden] { display: none; }
/* Short entries without their own case study page */
.work-grid div.card { background: transparent; border-style: dashed; }
.work-grid div.card .meta::after { content: " · Summary only"; }

/* Case study layout */
.cs { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px 64px; align-items: start; padding-block: 0 clamp(56px, 9vw, 96px); }
@media (max-width: 860px) { .cs { grid-template-columns: 1fr; } .cs aside { order: -1; } }
.cs article { display: grid; gap: 18px; }
.cs article h2 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; margin: 26px 0 0; line-height: 1.3; }
.cs article h2:first-child { margin-top: 0; }
.cs article ul { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; max-width: 64ch; }
.cs article li::marker { color: var(--accent); }
.facts { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 24px; display: grid; gap: 16px; position: sticky; top: 24px; }
@media (max-width: 860px) { .facts { position: static; } }
.facts dl { margin: 0; display: grid; gap: 14px; }
.facts dt { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 15px; }
.note { font-size: 14px; color: var(--muted); border-left: 3px solid var(--rule); padding-left: 14px; }
.callout { background: var(--accent-soft); border-radius: 12px; padding: 20px 22px; }
.callout p { max-width: none; }

/* Step flow diagram (pure HTML/CSS, wraps on small screens) */
.flow { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 10px; counter-reset: step; }
.flow li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 14px 16px; }
.flow li::before { content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; }
.flow li.mine { border-color: var(--accent); }
.flow b { display: block; font-weight: 600; }
.flow span { display: block; color: var(--muted); font-size: 15px; }
.flow .who { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }

/* Next/prev case studies */
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 28px; border-top: 1px solid var(--rule); }
.pager a { text-decoration: none; font-weight: 500; }

/* Publications and press */
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs > li { display: grid; grid-template-columns: 120px 1fr; gap: 4px 24px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.pubs > li:first-child { border-top: 1px solid var(--rule); }
@media (max-width: 600px) { .pubs > li { grid-template-columns: 1fr; } }
.pubs .when { font-size: 14px; color: var(--muted); padding-top: 2px; }
.pubs .what { display: grid; gap: 4px; }
.pubs .title { font-weight: 600; }
.pubs .sub { color: var(--muted); font-size: 15px; }
