/* pendulum-power.co.uk: the whole site's styling. No framework.
   Colours and type are the live site's (docs/design_tokens.md). */

:root {
  --black: #000;
  --white: #fff;
  --grey: #f7f7f7;
  --blue: #006edb;
  --blue-dark: #0057ae;
  --navy: #002952;
  --red: #a80404;
  --text: #000;
  --muted: #555;
  --font: "itc-avant-garde-gothic-pro", "Century Gothic", "Avant Garde", "URW Gothic", Arial, sans-serif;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(56px, 8vw, 120px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(30px, 4vw, 44px); }
h2 { font-size: clamp(26px, 3.2vw, 37px); }
h3, .h3 { font-size: clamp(20px, 2vw, 26px); }
.narrow h2.h3 { margin-top: 1.4em; }
p, ul, ol { margin: 0 0 1em; }
strong { font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 100; background: var(--white); padding: 8px 12px; }
.red { color: var(--red); }
/* pinned to the bottom: at the top it covered the mobile menu button */
.preview-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: #ffd23f; color: #000; font-size: 13px; font-weight: 600;
  text-align: center; padding: 4px 12px; }
.preview-bar a { color: #000; }

/* ---------- Header ---------- */
.site-header { position: absolute; inset: 0 0 auto; z-index: 10; color: var(--white);
  background: linear-gradient(rgba(0,0,0,.65), rgba(0,0,0,0)); }
.no-hero .site-header { position: static; background: var(--black); }
.header-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  padding-top: 24px; padding-bottom: 24px; }
.logo img { display: block; width: clamp(180px, 20vw, 280px); height: auto; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.topbar { margin: 0; font-size: 14px; font-weight: 400; display: flex; gap: 32px; flex-wrap: wrap; justify-content: flex-end; }
.topbar a { color: var(--white); text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; }
.main-nav li { position: relative; }
.main-nav a { display: block; color: var(--white); text-decoration: none; font-weight: 600;
  text-transform: uppercase; padding: 10px 16px; }
.main-nav a:hover, .main-nav a[aria-current] { color: #cfe4ff; }
/* the last item's right edge lines up with the email address above it (Ben, 2026-11-23) */
@media (min-width: 1001px) { .main-nav > ul > li:last-child > a { padding-right: 0; } }
.main-nav li ul { list-style: none; margin: 0; padding: 8px 0; position: absolute; top: 100%; left: 0;
  min-width: 240px; background: var(--white); box-shadow: 0 8px 24px rgba(0,0,0,.2);
  visibility: hidden; opacity: 0; transition: opacity .15s; }
.main-nav li ul a { color: var(--black); text-transform: none; font-weight: 400; padding: 8px 20px; }
.main-nav li ul a:hover { background: var(--grey); color: var(--blue); }
.main-nav li:hover > ul, .main-nav li:focus-within > ul { visibility: visible; opacity: 1; }
.menu-toggle { display: none; }

/* Mobile menu: a <details> toggle, no JavaScript */
@media (max-width: 1000px) {
  .header-inner { align-items: center; padding-top: 16px; padding-bottom: 16px; }
  .topbar { display: none; }
  .menu-toggle { display: block; }
  .menu-toggle summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; }
  .menu-toggle summary::-webkit-details-marker { display: none; }
  .menu-toggle summary span, .menu-toggle summary span::before, .menu-toggle summary span::after {
    content: ""; display: block; width: 26px; height: 2px; background: var(--white); position: relative; }
  .menu-toggle summary span::before { position: absolute; top: -8px; }
  .menu-toggle summary span::after { position: absolute; top: 8px; }
  .main-nav { display: none; }
  .menu-toggle[open] ~ .main-nav { display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--black); padding: 8px 0 16px; max-height: 80vh; overflow-y: auto; }
  .main-nav > ul { flex-direction: column; }
  .main-nav li ul { position: static; visibility: visible; opacity: 1; background: none; box-shadow: none; padding: 0 0 0 16px; }
  .main-nav li ul a { color: #ccc; }
  .main-nav a { padding: 10px var(--gutter); }
}

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; }
.section > .wrap > :last-child { margin-bottom: 0; }
.bg-grey { background: var(--grey); }
.bg-black { background: var(--black); color: var(--white); }
.bg-blue { background: var(--blue); color: var(--white); }
.bg-navy { background: var(--navy); color: var(--white); }
.bg-black a, .bg-blue a, .bg-navy a { color: var(--white); }
/* light text on dark backgrounds: one weight heavier, or the thin strokes blur */
.bg-black, .bg-blue, .bg-navy, .card-blue, .card-black, .hero, .image-band { font-weight: 400; }

.hero { position: relative; color: var(--white); background: var(--black) center / cover no-repeat;
  min-height: clamp(320px, 34vw, 470px); display: flex; align-items: flex-end; padding: 150px 0 clamp(48px, 6vw, 100px); }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--overlay, #000); opacity: var(--overlay-opacity, .45); }
.hero > .wrap { position: relative; width: 100%; }
.hero h1 { margin: 0; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.hero p { font-weight: 600; font-size: 18px; margin: .6em 0 0; }
/* A banner line that looks like the hero h1 when the page's real h1 is further down (case studies) */
.hero .hero-title { font-size: clamp(30px, 4vw, 44px); line-height: 1.2; margin: 0; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
h1.h2 { font-size: clamp(26px, 3.2vw, 37px); }

.photo-band { min-height: clamp(220px, 28vw, 420px); background: center / cover no-repeat; }
.image-band { position: relative; color: var(--white); background: center / cover no-repeat; }
.image-band::before { content: ""; position: absolute; inset: 0; background: var(--overlay, #000); opacity: var(--overlay-opacity, .6); }
.image-band > .wrap { position: relative; }

.cols { display: grid; gap: clamp(24px, 3vw, 40px); }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-2.split { grid-template-columns: 2fr 3fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .cols-2, .cols-2.split, .cols-3, .cols-4 { grid-template-columns: 1fr; } }
.cols > div > :last-child { margin-bottom: 0; }
.cols + .cols { margin-top: clamp(24px, 3vw, 40px); }

.card { background: var(--white); color: var(--text); border-radius: 10px; padding: clamp(24px, 3vw, 40px); }
.card-blue { background: var(--blue); color: var(--white); border-radius: 10px; padding: clamp(24px, 3vw, 40px); }
.card-black { background: var(--black); color: var(--white); padding: clamp(24px, 3vw, 40px); text-align: center; }
.card-black a { color: var(--white); }
/* Text sizes measured on the live site, 2026-11-16 (snagging #12), same at every width:
   intro beside a heading 24px / 35px; section text 17.6px / 28.8px; cards and tick lists 16px;
   case-study body 16px / 24px */
.lead { font-size: 24px; line-height: 1.47; }
.cols > div > p, .cols > div > ul:not(.ticks) > li { font-size: 17.6px; line-height: 1.64; }
.cols > div > ul:not(.ticks) > li { margin-bottom: .5em; }
.case-body { font-size: 16px; line-height: 1.5; }
/* Frequently asked questions (faq_html): question as a small heading, answer in body text size */
.faq h3 { font-size: 19px; margin: 1.4em 0 .35em; }
.faq h3:first-child { margin-top: 0; }
.faq p { font-size: 17.6px; line-height: 1.64; margin-top: 0; }
.upper { text-transform: uppercase; }
.bold { font-weight: 600; }
ul.ticks { list-style: none; padding: 0; }
ul.ticks li { position: relative; padding-left: 34px; margin-bottom: 14px; }
ul.ticks li::before { content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 10px;
  border-left: 4px solid var(--blue); border-bottom: 4px solid var(--blue); transform: rotate(-45deg) skew(-4deg); }
/* On coloured backgrounds the tick is white, as on the live site (snagging #13: blue on blue was invisible) */
.bg-blue ul.ticks li::before, .bg-navy ul.ticks li::before, .bg-black ul.ticks li::before, .card-blue ul.ticks li::before { border-color: var(--white); }
ul.ticks strong { font-weight: 400; }
ul.ticks li, .card { line-height: 1.5; }
.narrow { max-width: 820px; margin-left: auto; margin-right: auto; }
.centre { text-align: center; }
.centre img { margin: 0 auto; display: block; }
.label { font-size: 16px; text-transform: uppercase; }

.item + .item { margin-top: 20px; }
.right { text-align: right; margin: 0; }
/* back-to-back sections on the same background read as one block */
.bg-black + .bg-black, .bg-blue + .bg-blue, .bg-grey + .bg-grey, .bg-navy + .bg-navy { padding-top: 0; }
.icon-box h3 a { color: inherit; text-decoration: none; }
.icon-box h3 a:hover { color: var(--blue); }
.icon-box { display: grid; grid-template-columns: 90px 1fr; gap: 24px; align-items: start; }
.icon-box + .icon-box { margin-top: 20px; }
.icon-box img, .icon-box svg { width: 72px; height: auto; }
.icon-box .btn { margin-top: 8px; }
@media (max-width: 520px) { .icon-box { grid-template-columns: 1fr; } }

.btn { display: inline-block; background: var(--blue); color: var(--white) !important; text-decoration: none;
  text-transform: uppercase; font-weight: 600; font-size: 13px; letter-spacing: .02em;
  padding: 10px 26px; border-radius: 30px; }
.btn:hover { background: var(--blue-dark); }
.btn::after { content: " \2192"; }

/* Careers (careers/index.php): vacancy cards from /admin/ */
.jobs { display: grid; gap: 24px; margin: 16px 0 8px; }
.job { background: var(--white); border-radius: 10px; padding: clamp(20px, 3vw, 32px); }
.job h3 { margin: 0 0 4px; }
.job-meta { color: #555; font-size: 15px; margin: 0 0 16px; }
.job-body h4 { font-size: 17px; margin: 1.2em 0 .4em; }
.job-body h5 { font-size: 15px; margin: 1em 0 .3em; }
.job .btn { margin-top: 4px; }
.small-print { font-size: 14px; color: #555; margin-top: 2em; }

/* Cookie consent banner (includes/consent.php) */
.consent { position: fixed; left: 16px; bottom: 16px; z-index: 60; max-width: 420px; background: var(--white); color: var(--text);
  border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.25); padding: 18px 20px; font-size: 14px; font-weight: 400; }
.consent[hidden], #cookie-settings[hidden], #cookie-settings[hidden] + .sep { display: none; }
.consent p { margin: 0 0 12px; }
.consent-buttons { display: flex; gap: 10px; margin: 0 !important; }
.btn-consent { font: 600 14px var(--font); border-radius: 30px; padding: 9px 22px; cursor: pointer;
  background: var(--blue); color: var(--white); border: 2px solid var(--blue); }
.btn-consent.secondary { background: var(--white); color: var(--blue); }
@media (max-width: 480px) { .consent { left: 8px; right: 8px; bottom: 8px; max-width: none; } }

/* "Who we work with": title and carousel as one compact section */
.partners-section { padding: 48px 0 56px; }
.partners-title { font-size: 22px; text-align: center; margin: 0 0 24px; }

/* Carousel: pure CSS. The list is drawn twice and slid left by one copy, so it loops. */
.partners { --n: var(--n-desktop, 8); overflow: hidden; container-type: inline-size; }
@media (max-width: 1000px) { .partners { --n: min(var(--n-desktop, 8), 4); } }
@media (max-width: 600px)  { .partners { --n: min(var(--n-desktop, 8), 3); } }
.partners-track { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.partners-track li { flex: 0 0 calc(100cqw / var(--n)); display: grid; place-items: center; padding: 0 14px; height: 80px; }
.partners-track img { max-width: 100%; max-height: 64px; width: auto; height: auto; object-fit: contain; }
.partners.is-moving .partners-track { justify-content: flex-start; width: max-content;
  animation: partners-scroll calc(var(--count) * var(--speed)) linear infinite; }
.partners.is-moving.pause-on-hover:hover .partners-track { animation-play-state: paused; }
@keyframes partners-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .partners.is-moving .partners-track { animation: none; width: auto; flex-wrap: wrap; justify-content: center; }
  .partners-track .partners-copy { display: none; }  /* must outrank ".partners-track li" */
}

.logos { display: flex; flex-wrap: wrap; gap: 32px 48px; justify-content: center; align-items: center; }
.logos img { height: 64px; width: auto; max-width: 180px; object-fit: contain; }

.cases { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .cases { grid-template-columns: 1fr; } }
.case { background: var(--white); color: var(--text); border-radius: 10px; padding: clamp(24px, 3vw, 40px); }
.case img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: 24px; }
.case h3 { font-size: 19px; }
.case h3 a { color: var(--text); text-decoration: none; }
.case .more { text-transform: uppercase; font-weight: 600; font-size: 13px; text-decoration: none; }

/* "More from case studies" on a case study's own page: three compact, on black */
.cases.compact { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.cases.compact .case { background: none; color: var(--white); padding: 0; border-radius: 0; }
.cases.compact .case img { aspect-ratio: 3 / 2; margin-bottom: 14px; }
.cases.compact .case h3 { font-size: 15px; }
.cases.compact .case h3 a, .cases.compact .more { color: var(--white); }
.cases.compact .case p { font-size: 13px; }
@media (max-width: 800px) { .cases.compact { grid-template-columns: 1fr; } }

/* "More from Case Studies" carousel (includes/case-carousel.php): same mechanism as
   the logo carousel. Cards on black, compact, n per screen from /admin/. */
.case-carousel { --n: var(--n-desktop, 3); overflow: hidden; container-type: inline-size; margin: 0 -12px; }
@media (max-width: 1000px) { .case-carousel { --n: min(var(--n-desktop, 3), 2); } }
@media (max-width: 600px)  { .case-carousel { --n: 1; } }
.case-track { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.case-track > li { flex: 0 0 calc(100cqw / var(--n)); padding: 0 12px; }
.case-track .case { background: none; color: var(--white); padding: 0; border-radius: 0; }
.case-track .case img { aspect-ratio: 3 / 2; margin-bottom: 14px; }
.case-track .case h3 { font-size: 15px; }
.case-track .case h3 a, .case-track .more { color: var(--white); }
.case-track .case p { font-size: 13px; }
.case-carousel.is-moving .case-track { justify-content: flex-start; width: max-content;
  animation: partners-scroll calc(var(--count) * var(--speed)) linear infinite; }
/* Hover pause is a setting (pause-on-hover). Keyboard focus always pauses, so a link
   being tabbed to never slides away from under the cursor. */
.case-carousel.is-moving.pause-on-hover:hover .case-track, .case-carousel.is-moving:focus-within .case-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .case-carousel.is-moving .case-track { animation: none; width: auto; flex-wrap: wrap; justify-content: center; row-gap: 32px; }
  .case-track .case-copy { display: none; }
}
.draft-bar { margin: 0; padding: 10px 16px; background: #fde68a; color: #111; text-align: center; font-size: 14px; }

.callout-number { font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; }
.callout-number a { color: #4d8fe0 !important; text-decoration: none; }
.callout-number .red { color: #e01b1b; white-space: nowrap; }
.section img { vertical-align: middle; }
.cols img { margin-bottom: 1em; }

/* forms (contact page) */
.form { display: grid; gap: 20px; margin-top: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form label { display: grid; gap: 4px; font-size: 13px; font-weight: 400; color: var(--muted); }
.form input, .form textarea { font: inherit; font-size: 16px; color: var(--text); padding: 8px 2px;
  border: 0; border-bottom: 1px solid #cdd8e4; background: transparent; width: 100%; }
.form input:focus, .form textarea:focus { outline: none; border-bottom-color: var(--blue); }
.form [aria-invalid="true"] { border-bottom-color: var(--red); }
.form fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 24px 64px; flex-wrap: wrap; }
.form fieldset[aria-invalid="true"] legend { color: var(--red); }
.form legend { font-size: 13px; font-weight: 600; margin-bottom: 10px; width: 100%; }
.form .check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.form .check input { width: 18px; height: 18px; }
.btn-red { background: var(--red); color: var(--white); border: 0; border-radius: 3px; cursor: pointer;
  font: 600 13px var(--font); text-transform: uppercase; padding: 14px; width: 100%; }
.btn-red:hover { background: #8a0303; }
.form-error { color: var(--red); font-weight: 600; }
.form-done { font-size: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */
/* Footer in the system font, as on the live site: thin Avant Garde white-on-black
   rendered soft on Windows (Ben, 2026-11-11: "doesn't look very sharp") */
.site-footer { background: var(--black); color: var(--white); padding: 80px 0 32px; font-size: 14px; font-weight: 400;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
.footer-phone { font-family: var(--font); }
.site-footer a { color: var(--white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); }
.footer-grid > div { padding: 0 28px; }
.footer-grid > div + div { border-left: 1px dashed #666; }
.footer-main { font-size: 16px; }
.footer-main .footer-family { font-size: 14px; max-width: 22em; }
.footer-main img { width: 220px; height: auto; margin-bottom: 20px; }
.footer-phone { font-size: 26px; font-weight: 700; }
/* every column's logo sits in the same 60px box, so titles and links line up across columns */
.footer-division > a:first-child { display: flex; align-items: flex-end; height: 60px; }
.footer-division img { width: auto; max-width: 80px; max-height: 60px; }
.footer-division h2 { font-size: 15px; font-weight: 700; margin: 20px 0; min-height: 2.6em; }
.footer-division p a[href^="mailto:"] { white-space: nowrap; font-size: 13px; }
@media (min-width: 901px) and (max-width: 1180px) { .footer-division p a[href^="mailto:"] { font-size: 12px; } }
.footer-division ul { list-style: none; padding: 0; margin: 0; }
.footer-division li { margin-bottom: 10px; }
.linkedin { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 2px solid var(--white);
  border-radius: 50%; font-weight: 700; font-size: 13px; }
.footer-bottom { display: flex; align-items: center; gap: 20px; margin-top: 48px; font-size: 12px; }
.footer-bottom img { width: 60px; height: auto; }
.footer-bottom p { margin: 0; }
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px 0; }
  .footer-grid > div:nth-child(3) { border-left: 0; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div + div { border-left: 0; border-top: 1px dashed #666; padding-top: 32px; }
}
