/* Elliptica Research — shared site chrome.
   Holds only what is shared across pages (nav, footer, buttons, cards) or
   impossible inline (hover, focus, active-nav state). Section layouts and
   page copy keep their inline styles in each page's HTML. */

:root {
  --pagepad: max(56px, calc((100vw - 1180px) / 2));
}

body {
  margin: 0;
  background: var(--paper);
  font-family: "Jost", system-ui, sans-serif;
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-hover); }

/* Hover behaviours (formerly runtime style-hover attributes, which were
   injected with !important — kept here so they beat inline styles). */
.hov-ink { transition: color .18s ease; }
.hov-ink:hover { color: var(--navy) !important; }
.hov-tint { transition: background .18s ease; }
.hov-tint:hover { background: rgba(20, 32, 58, .025) !important; }
.hov-lift { transition: transform .18s ease, box-shadow .18s ease; }
.hov-lift:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(20, 32, 58, .12); }

/* Buttons (formerly the design-system Button component). */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--navy-hover); color: #fff; }
.btn--secondary { background: transparent; color: var(--navy); }
.btn--secondary:hover { background: rgba(20, 32, 58, .06); color: var(--navy); }
.btn--sm { font-size: 12px; padding: 9px 18px 9px calc(18px + .14em); }
.btn--md { font-size: 13px; padding: 13px 26px 13px calc(26px + .14em); }

/* Surface card (formerly the design-system Card component, elevation="card"). */
.card {
  background: #fff;
  color: var(--navy);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(20, 32, 58, .08);
  padding: 30px;
  box-sizing: border-box;
  width: 100%;
}
/* Fixed-ratio media slot for the work cards. The three images are a wide map,
   a square chart and a portrait book cover; without a common slot each pushes
   its card's body copy to a different baseline. The ratio scales with the
   column, so they stay aligned at any width. Each card sets its own slot
   background — for the map, one matching the image so the letterbox is
   invisible. */
.card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2;
  /* border-box so a slot's own padding or border sits inside the ratio —
     otherwise it adds to the height and the alignment this exists for breaks. */
  box-sizing: border-box;
  margin: -2px 0 6px;
  border-radius: 3px;
  overflow: hidden;
}
.card-media img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

/* Inline citations pointing at /references/. They sit inside already-muted
   caption text, so they inherit its colour and carry a dotted underline —
   visible without colour alone, and quiet enough that a row of them does not
   read as navigation. */
.cite {
  color: inherit;
  border-bottom: 1px dotted currentColor;
  transition: color .18s ease;
}
.cite:hover,
.cite:focus-visible { color: var(--navy); border-bottom-style: solid; }

/* In-copy prose links, as distinct from citations. The bare `a` rule sets navy
   with no underline, which against slate body text reads as emphasis rather
   than as a link. These carry a solid hairline underline instead, so a reader
   scanning a paragraph can see there is somewhere to go. Added 2026-08-12 with
   the descriptive internal links into /services/, which until then had no
   in-copy inbound link anywhere on the site. */
.lnk {
  color: inherit;
  border-bottom: 1px solid var(--hairline);
  transition: color .18s ease, border-color .18s ease;
}
.lnk:hover,
.lnk:focus-visible { color: var(--navy); border-bottom-color: currentColor; }

/* Sticky nav. */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 16px var(--pagepad);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 1px 12px rgba(20, 32, 58, .05);
}
/* Lockup follows design/guidelines/brand-lockup-ratios.html. Everything derives
   from the mark: wordmark = mark x 0.409, inset = mark x 0.303.

   The tagline does NOT hold a fixed ratio. The rule is a floor:
       tagline = max(9px, 0.389 x wordmark)
   Jost italic loses definition below 9px, so it stops shrinking. Ratio and
   floor meet at a 56px mark, which is why display sizes look ratio-driven and
   headers look floor-driven — one rule, not two. Once floored the tagline
   takes .02em tracking, and stays italic Slate 400: 500 competes with the
   wordmark.

   This is the 38px web-header cut: 38 / 15.5 / 9. Sized against the 11.5px
   nav links rather than for ratio fidelity — at a 56px mark the lockup
   out-sized the navigation. Sticky header is 70px. */
.nav-brand { display: flex; align-items: center; gap: 11.5px; min-width: 0; flex-shrink: 1; }
.nav-brand img { display: block; width: 38px; height: 38px; }
.nav-brand-text { display: flex; flex-direction: column; gap: 2.6px; min-width: 0; }
.nav-brand-name { font-size: 15.5px; color: var(--navy); line-height: 1; white-space: nowrap; }
.wordmark-strong { font-weight: 500; letter-spacing: .12em; }
.wordmark-light { font-weight: 300; letter-spacing: .333em; }
.nav-brand-tag {
  font-size: 9px;
  letter-spacing: .02em;
  font-style: italic;
  font-weight: 400;
  color: var(--slate);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  /* Sit with the wordmark rather than floating mid-header: this soaks up the
     free space so brand + links read as one unit and the CTA stays hard right. */
  margin-right: auto;
  gap: 20px;
  min-width: 0;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .12em;
  white-space: nowrap;
}
.nav-links a {
  color: var(--slate);
  border-bottom: 1px solid transparent;
  padding-bottom: 4px;
  transition: color .18s ease;
}
.nav-links a:hover { color: var(--navy); }
.nav-cta { flex: none; }

/* Mobile disclosure toggle. Ships with a `hidden` attribute that nav.js
   removes, so without JavaScript the links stay visible and simply wrap —
   degraded but navigable — rather than being hidden behind a dead button.
   `aria-expanded` is the only state: the CSS keys off it directly, so there is
   no class to keep in sync with what assistive tech reads. */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 8px 4px;
  background: none;
  border: 0;
  font-family: "Jost", system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy);
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--navy);
  transition: transform .18s ease, opacity .18s ease;
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
/* Open: the bars cross into an X. */
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* Anchor offset follows the sticky header height: 70px at desktop, 56px once
   the phone lockup shrinks. Without this, /#work lands with its heading
   tucked under the header. */
[style*="scroll-margin-top:88px"] { scroll-margin-top: 82px !important; }

/* Active nav state, driven by <body data-page="...">. */
body[data-page="home"] .nav-links a[href="/"],
body[data-page="approach"] .nav-links a[href="/approach/"],
body[data-page="services"] .nav-links a[href="/services/"],
body[data-page="capability"] .nav-links a[href="/capability/"],
body[data-page="writing"] .nav-links a[href="/writing/"],
body[data-page="contact"] .nav-links a[href="/contact/"] {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

/* Footer. The brand block is the horizontal lockup's text stacked under the
   mark, so the same ratios govern it; only the inset does not apply. 34px is the
   smallest mark the ladder allows a tagline on, and the footer is not
   height-constrained the way the sticky header is. */
.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr .6fr .6fr .8fr;
  gap: 44px;
  padding: 52px var(--pagepad) 34px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.footer-brand { display: flex; flex-direction: column; gap: 12px; }
.footer-brand img { display: block; width: 34px; height: 34px; }
.footer-brand-name { font-size: 13.9px; color: var(--navy); line-height: 1; }
.footer-brand-name .wordmark-light { letter-spacing: .333em; }
/* Floored at 9px with .02em tracking, italic Slate 400, per the spec. */
.footer-brand-tag {
  font-size: 9px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--slate);
  margin-top: -6px;   /* the uniform column gap is too wide under a 9px line */
}
/* Moved out of the CONTACT column 2026-08-12, so that column is contact
   *methods* only and the address is an attribute of the brand. Sized to match
   .footer-col span rather than the 9px tagline above it, so it reads as
   information rather than as part of the lockup. */
.footer-brand-addr { font-size: 14px; font-weight: 300; line-height: 1.6; color: var(--slate); margin-top: 4px; }
.footer-col { display: flex; flex-direction: column; gap: 11px; }
.footer-head { font-size: 10.5px; letter-spacing: .2em; color: var(--muted); margin-bottom: 3px; }
.footer-col a, .footer-col span { font-size: 14px; font-weight: 300; color: var(--slate); }
.footer-col a { transition: color .18s ease; }
.footer-col a:hover { color: var(--navy); }
.footer-legal {
  padding: 20px var(--pagepad) 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--muted);
}

/* Contact form. */
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 11px; font-weight: 500; letter-spacing: .2em; color: var(--muted); }
.form-input {
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 6px;
  font-family: "Jost", system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 300;
  color: var(--navy);
  background: var(--paper);
  outline: none;
  transition: border-color .18s ease;
  width: 100%;
  box-sizing: border-box;
}
.form-input:focus { border-color: var(--navy); }
textarea.form-input { resize: vertical; line-height: 1.6; }

/* Sector chips: visually-hidden radios styled as pills. */
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; border: 0; padding: 0; margin: 0; }
.chip-input { position: absolute; opacity: 0; pointer-events: none; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--slate);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
/* Same pill for listing capabilities, minus everything that suggests it can be
   clicked — no pointer cursor, no hover state. */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 15px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 300;
  letter-spacing: .06em;
  color: var(--slate);
}
.chip-input:checked + .chip { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-input:focus-visible + .chip { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Honeypot: off-screen rather than display:none so naive bots still fill it. */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ===========================================================================
   Responsive layer.

   These pages were flattened from a design-tool export, so section layout
   lives in inline style attributes. Two mechanisms, chosen by kind:

     - a CLASS where the right mobile behaviour differs per instance (the
       .l-* grid vocabulary): a two-column split must collapse before an
       even pair does, and a blunt selector cannot express that;
     - an ATTRIBUTE SELECTOR where behaviour is uniform by value (type scale,
       section rhythm). Every inline size is written `font-size:NNpx` with no
       space, and no value is a substring of another, so the match is exact.

   Both need !important to beat an inline style — the same reason .hov-* above
   uses it. Everything sits inside a max-width query, so above 1080px this
   whole layer is inert and the desktop design is untouched.

   Tracks use minmax(0, 1fr), never 1fr: an fr track's automatic minimum is
   min-content, so a plain 1fr still grows to fit the longest word and the
   document overflows. That is the actual cause of the clipped hero headline.
   =========================================================================== */

/* ---- Narrow desktop and landscape tablet --------------------------------- */
@media (max-width: 1080px) {
  :root { --pagepad: 40px; }
  .l-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .l-side { padding-left: 40px !important; }
}

/* ---- The two-column splits stop fitting ---------------------------------- */
@media (max-width: 900px) {
  .l-split { grid-template-columns: minmax(0, 1fr) !important; gap: 40px !important; }
  .l-side {
    padding-left: 0 !important;
    border-left: 0 !important;
    padding-top: 30px !important;
    border-top: 1px solid var(--hairline) !important;
  }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 36px 40px; }

  /* Nav becomes a disclosure menu here rather than at a phone width: four
     links already need ~300px, and Capability and Writing are due back, so
     768px would be on a knife edge. */
  .nav-toggle { display: inline-flex; }
  .nav-toggle[hidden] { display: none; }
  .site-nav { flex-wrap: wrap; gap: 0 16px; padding-top: 12px; padding-bottom: 12px; }
  .nav-links { flex-basis: 100%; margin-right: 0; }
  /* :not([hidden]) matters: the button ships with BOTH hidden and
     aria-expanded="false", so without this a no-JS visitor would get a hidden
     button AND hidden links — no navigation at all. */
  .nav-toggle:not([hidden])[aria-expanded="false"] + .nav-links { display: none; }
  .nav-toggle[aria-expanded="true"] + .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    font-size: 13px;
    padding-bottom: 6px;
  }
  .nav-toggle[aria-expanded="true"] + .nav-links a {
    padding: 13px 0;            /* 44px tap target */
    border-bottom: 1px solid var(--hairline);
  }
  /* No JS: the button stays hidden and the links wrap instead of disappearing. */
  .nav-toggle[hidden] + .nav-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
}

/* ---- Phone --------------------------------------------------------------- */
@media (max-width: 640px) {
  /* 56px of gutter each side leaves 278px of a 390px phone. This one line
     recovers 68px of content width across every page and both chrome blocks. */
  :root { --pagepad: 22px; }

  .l-rail, .l-even, .l-cards { grid-template-columns: minmax(0, 1fr) !important; }
  .l-rail { gap: 10px !important; }
  .l-even { gap: 0 !important; }
  .l-cards { gap: 18px !important; }

  /* 34px is the smallest mark the ladder allows a tagline on, so the phone
     lockup keeps it. Wordmark 13.9, tagline at the 9px floor, inset 10.3. */
  .nav-brand img { width: 34px; height: 34px; }
  .nav-brand-name { font-size: 13.9px; }
  .nav-brand { gap: 10.3px; }
  [style*="scroll-margin-top:88px"] { scroll-margin-top: 68px !important; }
  .footer-cols { grid-template-columns: 1fr; gap: 28px; }
  .footer-legal { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Buttons. .btn is white-space:nowrap, and "START A CONVERSATION" at 13px
     with .14em tracking is wider than the content box on its own — a pair of
     them side by side cannot fit at any phone width. Stack and stretch. */
  .btn { white-space: normal; text-align: center; line-height: 1.25; }
  .btn--md { padding: 14px 20px; }
  .cta-row { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
  /* The label-beside-button rows have the same problem, one button at a time. */
  [style*="justify-content:space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Below 16px iOS Safari zooms the viewport when an input takes focus, which
     on the site's only conversion path is the worst place for it. */
  .form-input { font-size: 16px; }

  .card { padding: 22px; }
  /* The 3:2 slot exists to align three cards side by side. Stacked there is
     nothing to align to, and a portrait cover in a 3:2 box fills the screen. */
  .card-media { aspect-ratio: auto; height: 170px; }

  /* Type scale. Every inline size is written font-size:NNpx with no space, and
     no value is a substring of another, so these matches are exact. Body copy
     at 16px and below is deliberately left alone — it must not shrink further
     on a phone. */
  [style*="font-size:54px"]   { font-size: 34px   !important; }
  [style*="font-size:46px"]   { font-size: 30px   !important; }
  [style*="font-size:44px"]   { font-size: 34px   !important; }
  [style*="font-size:40px"]   { font-size: 30px   !important; }
  [style*="font-size:36px"]   { font-size: 27px   !important; }
  [style*="font-size:32px"]   { font-size: 25px   !important; }
  [style*="font-size:30px"]   { font-size: 24px   !important; }
  [style*="font-size:28px"]   { font-size: 24px   !important; }
  [style*="font-size:26px"]   { font-size: 21px   !important; }
  [style*="font-size:22px"]   { font-size: 19px   !important; }
  [style*="font-size:21px"]   { font-size: 18px   !important; }
  [style*="font-size:20px"]   { font-size: 17px   !important; }
  [style*="font-size:19px"]   { font-size: 17px   !important; }
  [style*="font-size:18px"]   { font-size: 16.5px !important; }
  [style*="font-size:17px"]   { font-size: 16px   !important; }

  /* Tracking, not size, is what makes the small caps labels wrap. */
  [style*="letter-spacing:.24em"] { letter-spacing: .16em !important; }
  [style*="letter-spacing:.2em"]  { letter-spacing: .14em !important; }

  /* Long addresses are the one string that cannot break on its own. */
  a[href^="mailto:"] { overflow-wrap: anywhere; }
}

/* ---- The approach page's six-step flow diagram --------------------------- */
/* Its own breakpoint: the binding constraint is the label "Individual
   readiness" at 13.5px, not the container. Stacked rather than scrolled —
   the six steps are re-presented immediately below as a vertical list, so a
   carousel hiding steps 3-6 behind a swipe would sit directly above a full
   vertical version of the same thing. Wrapping to a grid is worse still: the
   arrows only read in a single line. */
@media (max-width: 760px) {
  .flow { flex-direction: column !important; align-items: stretch !important; gap: 8px !important; }
  .flow > :nth-child(even) { display: none !important; }   /* the arrow glyphs */
  .flow > :nth-child(odd) { padding: 16px 18px !important; }
}

/* ---- The booking CTA drops into the disclosure menu ---------------------- */
/* Its own breakpoint, measured rather than chosen: the lockup, toggle and
   button share one row down to 525px and wrap at 520px, which takes the sticky
   header from 59px to 93px on every page. A wrapped CTA is not terrible, but
   93px of permanently sticky chrome is 11% of a 390x844 phone, and the pages
   already carry their own in-content booking and contact paths. So below this
   the button joins the menu instead. 560px rather than 525px leaves headroom,
   and the headroom has already earned its keep: the threshold is a function of
   the button's copy, and relabelling "Book a call" to "Get in touch" moved it
   5px on its own (520/515 before, 525/520 after). Re-measure on a copy change
   rather than assuming, but the band absorbs a word or so either way.

   The selectors mirror the .nav-links ones exactly so the button and the links
   share all three states — collapsed (neither), expanded (both), no-JS (both).
   `~` not `+` because .nav-links sits between the toggle and the button. */
@media (max-width: 560px) {
  /* border-box because .btn is content-box: this file has no global reset, and
     without it the button's 36px of horizontal padding is added to the 100%
     basis and it overhangs the right gutter. */
  .nav-cta { flex: 0 0 100%; box-sizing: border-box; margin: 2px 0 6px; }
  .nav-toggle:not([hidden])[aria-expanded="false"] ~ .nav-cta { display: none; }
}

/* ---- Narrow phones ------------------------------------------------------- */
/* At 360px — most Android handsets — the lockup and a "MENU"-labelled toggle
   cannot share one row. Given the choice, the word goes and the tagline stays:
   the bars are a universally read control, whereas the tagline is the brand.
   The button keeps aria-label="Menu", so its accessible name is unchanged. */
@media (max-width: 400px) {
  .nav-toggle-label { display: none; }
  .nav-toggle { gap: 0; padding: 8px 2px; }
}

/* Below this even the wordmark-only lockup and the bars stop fitting, so the
   tagline comes off rather than being squeezed — design's rule. The mark
   returns to 32px, the ladder's 28-33px wordmark-only band. */
@media (max-width: 330px) {
  .nav-brand-tag { display: none; }
  .nav-brand img { width: 32px; height: 32px; }
  .nav-brand-name { font-size: 13px; }
  .nav-brand { gap: 10px; }
}
