/* elixr site: responsive + shared behaviour. The design is built with inline
   styles, so mobile work happens here with targeted overrides. */

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; }
img { max-width: 100%; }
header { position: relative; z-index: 3; }
footer { font-family: 'Inter Tight', sans-serif; }
header a, header nav { position: relative; z-index: 4; }

a:focus-visible, button:focus-visible { outline: 2px solid #DC0A78; outline-offset: 3px; border-radius: 4px; }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  section[style*="padding:120px 40px"] { padding: 84px 28px !important; }
  /* the closing band headline is set to never wrap, which crops it on narrow screens */
  #v-talk h2 { white-space: normal !important; }
  [style*="max-width:1280px"], [style*="max-width:1240px"] { padding-left: 28px !important; padding-right: 28px !important; }
}

/* ---------- phone ---------- */
@media (max-width: 820px) {

  /* --- hero: stop absolute stacking, let it flow --- */
  section[style*="height:900px"] {
    height: auto !important;
    min-height: 0 !important;
    margin: 10px !important;
    border-radius: 22px !important;
    padding: 22px 20px 26px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 22px !important;
  }
  section[style*="height:900px"] > *:not(img):not([style*="inset:0"]) {
    position: relative !important;
    z-index: 2;
    left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
  }
  section[style*="height:900px"] > div[style*="top:120px"] {
    flex-direction: column !important;
    gap: 6px !important;
    order: 2;
  }
  section[style*="height:900px"] > div[style*="top:200px"] { order: 3; }
  section[style*="height:900px"] > div[style*="bottom:40px"] {
    order: 4;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 22px !important;
  }
  section[style*="height:900px"] header { order: 1; }
  section[style*="height:900px"] h1,
  section[style*="height:900px"] > div[style*="bottom:40px"] > div > div,
  section[style*="height:900px"] > div[style*="bottom:40px"] > div > p { text-shadow: 0 2px 18px rgba(0,0,0,.45); }
  section[style*="height:900px"] h1 {
    font-size: clamp(34px, 10.5vw, 58px) !important;
    line-height: .95 !important;
    letter-spacing: -.03em !important;
  }
  section[style*="height:900px"] h1 span[style*="text-align:right"] { text-align: left !important; }
  section[style*="height:900px"] > div[style*="bottom:40px"] > div { max-width: none !important; width: auto !important; flex: 1 1 auto !important; }

  /* --- headers and nav --- */
  header {
    position: relative !important;
    z-index: 3;
    left: auto !important; right: auto !important; top: auto !important;
    margin: 10px 10px 0 !important;
    padding: 12px 14px !important;
    border-radius: 20px !important;
    gap: 12px !important;
    row-gap: 12px !important;
  }
  header nav, nav[style*="gap:28px"] {
    gap: 14px 16px !important;
    font-size: 13px !important;
    width: 100%;
    justify-content: flex-start !important;
  }
  header nav a[style*="linear-gradient"] { padding: 10px 16px !important; font-size: 11px !important; }
  .fu { left: 10px !important; right: 10px !important; top: 10px !important; padding: 10px 14px !important; border-radius: 20px !important; }
  .fu nav { gap: 12px 14px !important; font-size: 12px !important; }
  .fu img { height: 20px !important; }

  /* --- long pills become cards --- */
  div[style*="border-radius:999px"][style*="padding:22px 40px"] {
    border-radius: 22px !important;
    padding: 24px 22px !important;
    gap: 22px 28px !important;
  }
  div[style*="border-radius:999px"][style*="padding:22px 40px"] > div {
    gap: 28px 32px !important;
    justify-content: flex-start !important;
  }

  /* --- generic layout --- */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="display:flex"][style*="gap:48px"], [style*="display:flex"][style*="gap:64px"] { gap: 28px !important; }
  section { padding-left: 20px !important; padding-right: 20px !important; }
  section[style*="padding:120px 40px"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  h1 { font-size: clamp(34px, 10.5vw, 58px) !important; line-height: .96 !important; }
  h2 { font-size: clamp(30px, 8.5vw, 48px) !important; line-height: 1 !important; letter-spacing: -.03em !important; }
  h3 { font-size: 22px !important; }
  p, li { font-size: 16px !important; }

  /* --- footer --- */
  footer { padding: 16px 10px 10px !important; }
  footer > div { border-radius: 22px !important; padding: 36px 22px 26px !important; }
  footer [style*="padding:24px 104px 0 0"] { padding-right: 0 !important; }

  /* --- tables scroll rather than squash --- */
  table { display: block; overflow-x: auto; width: 100%; }

  /* --- Lix --- */
  [data-lix] { right: 14px !important; bottom: 14px !important; }
  [data-lix] [style*="width:360px"], [data-lix] [style*="width:380px"] {
    width: calc(100vw - 28px) !important;
    max-width: 380px !important;
  }
}

@media (max-width: 460px) {
  header nav a[style*="linear-gradient"] { width: 100%; text-align: center; }
  section[style*="height:900px"] { padding: 18px 16px 22px !important; }
}

/* ---------- consent banner ---------- */
#elixr-consent {
  position: fixed; left: 14px; bottom: 14px; z-index: 60;
  max-width: 340px; background: rgba(255,255,255,.97);
  border: 1px solid #E2E1DB; border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.14);
  font-family: 'Inter Tight', sans-serif; font-size: 13px; line-height: 1.45; color: #5E5E59;
}
#elixr-consent p { margin: 0 0 10px; }
#elixr-consent a { color: #141414; }
#elixr-consent .row { display: flex; gap: 8px; align-items: center; }
#elixr-consent button {
  font: inherit; cursor: pointer; border-radius: 999px; padding: 7px 14px;
  border: 1px solid #E2E1DB; background: #fff; color: #141414;
}
#elixr-consent button.yes {
  border: 0; color: #fff;
  background: linear-gradient(90deg,#F06428 0%,#DC0A78 35%,#7A3B9E 70%,#2680B4 100%);
}
@media (max-width: 820px) {
  #elixr-consent { left: 10px; right: 10px; bottom: 10px; max-width: none; }
  [data-lix] { bottom: 118px !important; }
}

/* ---------- mobile menu button ---------- */
.navbtn { display: none; }

@media (max-width: 820px) {
  .navbtn {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 36px; padding: 0 8px; border: 0; background: none; cursor: pointer;
    margin-left: auto;
  }
  .navbtn span { display: block; height: 2px; background: #141414; border-radius: 2px; }
  header nav, .fu nav { display: none !important; }
  header.nav-open nav, .fu.nav-open nav {
    display: flex !important; flex-direction: column;
    align-items: flex-start !important; justify-content: flex-start !important;
    width: 100%; gap: 15px; padding: 10px 4px 4px; font-size: 16px !important;
  }
  header.nav-open nav a, .fu.nav-open nav a { width: 100%; }
  header.nav-open nav a[style*="linear-gradient"] { text-align: center; padding: 13px 18px !important; }

  /* quieter hero: drop the strapline strip and the line that repeats below */
  section[style*="height:900px"] > div[style*="top:120px"] { display: none !important; }
  section[style*="height:900px"] > div[style*="bottom:40px"] > div[style*="flex:1 1 420px"] > div:first-child { display: none !important; }

  /* partner strip reads better centred */
  div[style*="border-radius:999px"][style*="padding:22px 40px"] {
    text-align: center; justify-content: center !important; align-items: center !important;
  }
  div[style*="border-radius:999px"][style*="padding:22px 40px"] > div { justify-content: center !important; }

  /* two ways cards: picture and title only */
  .tw-card { min-height: 300px !important; }
  .tw-desc { display: none; }
  .tw-title { font-size: 26px !important; }

  /* closing band */
  #v-talk h2 { font-size: clamp(30px, 8.5vw, 44px) !important; }
  #v-talk > div[style*="padding:150px"] { padding: 90px 22px 30px !important; gap: 26px !important; }
  #v-talk > div > div[style*="max-width:360px"] { max-width: none !important; }

  /* footer: nothing cropped on the right */
  footer [style*="padding:24px"] { padding-right: 0 !important; }
  footer [style*="flex:1 1 480px"] { flex: 1 1 100% !important; }
  footer [style*="gap:64px"] { gap: 32px !important; }
}

/* ---------- round two of mobile work ---------- */
@media (max-width: 820px) {

  /* hero fills the first screen, headline carries it */
  section[style*="height:900px"] {
    min-height: calc(100vh - 20px) !important;
    min-height: calc(100svh - 20px) !important;
    justify-content: space-between !important;
    padding-bottom: 20px !important;
  }
  section[style*="height:900px"] h1 {
    font-size: clamp(38px, 11.4vw, 68px) !important;
    line-height: .92 !important;
  }
  section[style*="height:900px"] > div[style*="bottom:40px"] { gap: 16px !important; }
  section[style*="height:900px"] > div[style*="bottom:40px"] > div[style*="flex:1 1 420px"] p { font-size: 15px !important; }

  /* the benefits card was eating the screen */
  section[style*="height:900px"] div[style*="backdrop-filter"] {
    width: auto !important; padding: 15px 16px !important; gap: 9px !important; border-radius: 18px !important;
  }
  section[style*="height:900px"] div[style*="backdrop-filter"] > div { font-size: 15px !important; gap: 11px !important; }
  section[style*="height:900px"] div[style*="backdrop-filter"] svg { width: 17px !important; height: 17px !important; }
  section[style*="height:900px"] div[style*="backdrop-filter"] a {
    padding: 13px 16px !important; font-size: 11.5px !important; margin-top: 2px;
  }

  /* partner logos: one slim banner, one row */
  div[style*="border-radius:999px"][style*="padding:22px 40px"] {
    border-radius: 16px !important; padding: 12px 6px !important;
    flex-direction: column !important; gap: 8px !important;
  }
  section:has(> div > div > img[alt="AECOM"]), section:has(> div > img[alt="AECOM"]) {
    padding-left: 10px !important; padding-right: 10px !important;
  }
  div:has(> img[alt="AECOM"]) {
    flex-wrap: nowrap !important; gap: 14px !important; width: 100%;
    justify-content: center !important; align-items: center !important;
    overflow-x: auto; scrollbar-width: none;
  }
  div:has(> img[alt="AECOM"])::-webkit-scrollbar { display: none; }
  div:has(> img[alt="AECOM"]) img { height: 15px !important; width: auto !important; flex: none; }
  div:has(> img[alt="AECOM"]) img[alt="Innovate UK"] { height: 24px !important; }
  div:has(> img[alt="AECOM"]) img[alt="Tech Nation"] { height: 14px !important; }

  /* menu button must not break out of the pill */
  header.nav-open nav a, .fu.nav-open nav a { box-sizing: border-box; }

  /* at a glance: one block per row, each value labelled */
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"]:not([style*="border-top"]) { display: none !important; }
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] {
    display: block !important; padding: 18px 0 !important;
  }
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] > span:first-child {
    display: block; font-size: 11px !important; letter-spacing: .14em; text-transform: uppercase;
    color: #8B8B86 !important; margin-bottom: 10px;
  }
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] > span:nth-child(2),
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] > span:nth-child(3) {
    display: block; font-size: 16px !important; margin-bottom: 12px;
  }
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] > span:nth-child(3) { margin-bottom: 0; }
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] > span:nth-child(2)::before {
    content: 'Fee-based'; display: block; font-size: 10.5px; letter-spacing: .12em;
    text-transform: uppercase; color: #F06428; margin-bottom: 3px;
  }
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] > span:nth-child(3)::before {
    content: 'Partnership'; display: block; font-size: 10.5px; letter-spacing: .12em;
    text-transform: uppercase; color: #DC0A78; margin-bottom: 3px;
  }
  div[style*="border-radius:28px"][style*="padding:12px 36px"] { padding: 6px 20px !important; }
}

/* ---------- round three ---------- */
@media (max-width: 820px) {
  /* Lix waits until the visitor is past the first screen */
  [data-lix] {
    opacity: 0; visibility: hidden; transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
  }
  html.scrolled-past-hero [data-lix] { opacity: 1; visibility: visible; transform: none; }

  /* the strapline above the logos is noise on a phone */
  div[style*="border-radius:999px"][style*="padding:22px 40px"] > span { display: none !important; }

  /* tidier heading breaks, no single word stranded on its own line */
  h1, h2 { text-wrap: balance; }
  section h2 { font-size: clamp(23px, 6.3vw, 40px) !important; line-height: 1.04 !important; }
  section h1 { font-size: clamp(27px, 7.4vw, 56px) !important; line-height: 1.02 !important; }

  /* at a glance: a real two column table */
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px 14px !important;
    padding: 16px 0 !important;
  }
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] > span:first-child {
    grid-column: 1 / -1;
    font-size: 11px !important; letter-spacing: .14em; text-transform: uppercase;
    color: #8B8B86 !important; margin-bottom: 4px;
  }
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] > span:nth-child(2),
  [style*="grid-template-columns:1fr 1.4fr 1.4fr"][style*="border-top"] > span:nth-child(3) {
    display: block; font-size: 15px !important; line-height: 1.3; margin: 0 !important;
  }
}
