/* ============================================================
   Breakpoints (used in @media rules, not as CSS variables):
   - Small (mobile):  max-width: 639px
   - Tablet:          min-width: 640px
   - Desktop:         min-width: 960px
   - Wide:            min-width: 1280px
   ============================================================ */

/* Cross-Document View Transitions — opts every same-origin navigation
   into a smooth crossfade. Supported in Chrome/Edge 126+ and Safari 18+;
   Firefox falls back to an instant swap (functional, just no animation).
   Applies to the preview iframe and production identically: the page
   the iframe is loading triggers the transition on its own document.
   Using browser defaults (~300ms crossfade) — override here later if a
   snappier or more bespoke timing is wanted. */
@view-transition { navigation: auto; }

:root {
  /* Tonal palette */
  --background-10: #0d1822;
  --background-20: #111e2a;
  --background-80: #eef4f7;
  --background-90: #ffffff;

  /* Text tones */
  /* On light backgrounds (80/90), --text is used for headings (deliberately softer, */
  /* since bigger/heavier text can carry less contrast) and --text-muted is used for */
  /* body text (stronger contrast, since smaller/thinner text needs it for legibility). */
  --text-10: #e8ecef;
  --text-10-muted: #b0bcc6;
  --text-20: #ffffff;
  --text-20-muted: #c6cfd6;
  --text-80: #203241;
  --text-80-muted: #1c2833;
  --text-90: #203241;
  --text-90-muted: #1c2833;

  /* Primary accent (Nutropic pink) */
  --primary-10: #ac4f73;
  --primary-10-muted: #b03d69;
  --primary-20: #c7517f;
  --primary-20-muted: #b03d69;
  --primary-80: #cb336d;
  --primary-80-muted: #8f264e;
  --primary-90: #cb336d;
  --primary-90-muted: #8f264e;

  /* Secondary accent (Nutropic light blue) */
  --secondary-10: #b8dbe8;
  --secondary-10-muted: #8ab0c0;
  --secondary-20: #b8dbe8;
  --secondary-20-muted: #8ab0c0;
  --secondary-80: #4a7a92;
  --secondary-80-muted: #3a6078;
  --secondary-90: #4a7a92;
  --secondary-90-muted: #3a6078;

  /* Typography families */
  --font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Weights */
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --weight-black: 900;

  /* Sizes — fluid from mobile floor to desktop ceiling (~2560px).
     The `+ Yrem` component preserves user font-size preferences for accessibility. */
  --size-hero: clamp(2.25rem, 2.5vw + 1rem, 5rem);
  --size-h2: clamp(1.8rem, 1.5vw + 1rem, 3.5rem);
  --size-h3: clamp(1.125rem, 0.5vw + 1rem, 1.5rem);
  --size-body: clamp(1rem, 0.25vw + 0.75rem, 1.25rem);
  --size-deck: clamp(1.1rem, 0.5vw + 0.75rem, 1.5rem);
  --size-kicker: clamp(0.9rem, 0.25vw + 0.8rem, 1.125rem);
  --size-small: clamp(0.875rem, 0.2vw + 0.8rem, 1rem);
  --size-button: clamp(0.85rem, 0.3vw + 0.6rem, 1rem);
  --size-menu: clamp(1rem, 0.25vw + 0.9rem, 1.125rem);
  --size-card-title: 1.125rem;

  /* Decorative line thicknesses */
  --kicker-line-thickness: 0.15rem;   /* underline beneath kicker labels */

  /* Icon sizes — fluid, rem-based, 9-step scale.
     Override these per site to retune the visual rhythm; modifier classes
     in components/icon/styles.css read these variables. */
  --icon-size-3xs: clamp(0.75rem, 0.3vw + 0.65rem, 0.875rem);  /*  12px – 14px */
  --icon-size-2xs: clamp(0.875rem, 0.3vw + 0.75rem, 1rem);     /*  14px – 16px */
  --icon-size-xs:  clamp(1rem, 0.4vw + 0.85rem, 1.25rem);      /*  16px – 20px */
  --icon-size-sm:  clamp(1.25rem, 0.5vw + 1rem, 1.75rem);      /*  20px – 28px */
  --icon-size-md:  clamp(1.5rem, 0.5vw + 1.25rem, 2rem);       /*  24px – 32px */
  --icon-size-lg:  clamp(1.75rem, 0.5vw + 1.5rem, 2.25rem);    /*  28px – 36px */
  --icon-size-xl:  clamp(2.25rem, 1vw + 1.75rem, 3rem);        /*  36px – 48px */
  --icon-size-2xl: clamp(3rem, 1.2vw + 2.5rem, 4rem);          /*  48px – 64px */
  --icon-size-3xl: clamp(4rem, 2vw + 3rem, 6rem);              /*  64px – 96px */

  /* Material Symbols variable-axis defaults — overridable per icon via
     modifier classes or inline style. Fill is boolean (0/1); weight 100..700;
     grade -50..200; optical-size 20..48 (paired to each size class below).
     `--icon-base-weight` is the reference value the smallest/largest size
     classes shift around (+100/+200 / -100/-200). `--icon-weight` is what
     font-variation-settings reads, defaulting to the base. */
  --icon-fill: 0;
  --icon-base-weight: 350;
  --icon-weight: var(--icon-base-weight);
  --icon-grade: 0;
  --icon-optical-size-3xs: 20;
  --icon-optical-size-2xs: 20;
  --icon-optical-size-xs: 20;
  --icon-optical-size-sm: 24;
  --icon-optical-size-md: 28;
  --icon-optical-size-lg: 32;
  --icon-optical-size-xl: 40;
  --icon-optical-size-2xl: 48;
  --icon-optical-size-3xl: 48;

  /* Logo height — scales gently with viewport */
  --logo-height: clamp(1.75rem, 0.5vw + 1.5rem, 2.5rem);     /*  28px – 40px */

  /* Line heights */
  --leading-none: 1;           /* standalone visual UI text (labels, copyright, buttons) */
  --leading-tight: 1.2;        /* headings that may wrap to 2+ lines */
  --leading-normal: 1.5;       /* body text, decks */
  --leading-relaxed: 1.7;      /* prose paragraphs */
  --leading-loose: 2;          /* elements needing extra breathing room */

  /* Letter spacing */
  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.1em;

  /* Spacing scale — small tokens fixed, larger tokens fluid */
  --space-1: clamp(0.25rem, 0.2vw + 0.25rem, 0.5rem);
  --space-2: clamp(0.5rem, 0.4vw + 0.5rem, 1rem);
  --space-3: clamp(0.75rem, 0.5vw + 0.7rem, 1.5rem);
  --space-4: clamp(1rem, 0.7vw + 0.8rem, 2rem);
  --space-5: clamp(1.5rem, 1vw + 1.1rem, 3rem);
  --space-6: clamp(2rem, 1.5vw + 1.5rem, 4rem);
  --space-7: clamp(3rem, 2.2vw + 2.2rem, 6rem);
  --space-8: clamp(4rem, 3vw + 3rem, 8rem);
  --space-9: clamp(6rem, 5vw + 4rem, 12rem);
  --space-10: clamp(8rem, 6vw + 5rem, 16rem);

  /* Padding tokens — chrome (header/footer) is tighter than content sections.
     Content padding grows non-linearly: base 5% of viewport, plus an additional
     0.15 * (viewport - 1280px) once viewport exceeds 1280px. This means the
     percentage of viewport used for padding increases as the screen grows larger
     (5% at 1280px → ~12% at 2560px → 15% at 3840px). Two tunable numbers:
     the threshold (1280px) and the boost multiplier (0.15). */
  --padding-content-x: clamp(
    1.25rem,
    calc(6vw +
      max(0px, (100vw - 900px) * 0.04) +
      max(0px, (100vw - 1200px) * 0.06) +
      max(0px, (100vw - 1500px) * 0.08) +
      max(0px, (100vw - 1800px) * 0.1)
    ),
    40rem
  );
  --padding-chrome-x: clamp(1rem, 1.5vw + 0.4rem, 5rem);
  --padding-section-y: clamp(3.5rem, 6vw + 1.5rem, 8rem);
  --padding-footer-top: clamp(2.5rem, 3vw + 1rem, 4rem);
  --padding-footer-bottom: clamp(2rem, 2vw + 1rem, 3rem);

  /* Header height — fluid from 4rem on mobile to 5rem at wide viewports */
  --header-height: clamp(4rem, 1vw + 3.25rem, 5rem);

  /* Radii */
  --radius-sm: 0.1875rem;   /* ~3px */
  --radius-md: 0.375rem;    /* ~6px */
  --radius-lg: 0.75rem;     /* ~12px */
  --radius-pill: 62.5rem;   /* ~1000px, effectively fully rounded */

  /* Shadows */
  --shadow-sm: 0 0.0625rem 0.125rem rgba(7, 27, 40, 0.05);
  --shadow-md: 0 0.25rem 1rem rgba(7, 27, 40, 0.08);
  --shadow-lg: 0 0.5rem 2rem rgba(7, 27, 40, 0.12);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-default: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Animation */
  --anim-duration: 0.6s;
  --anim-offset: 1.25rem;
  --anim-easing: cubic-bezier(0.22, 1, 0.36, 1);
  --anim-stagger: 80ms;

  --anim-delay-1: 0s;
  --anim-delay-2: 0.1s;
  --anim-delay-3: 0.2s;
  --anim-delay-4: 0.3s;
}

/* --- Reset / base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: var(--size-body);
  line-height: var(--leading-normal);
  background-color: var(--background-90);
  color: var(--text-90);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

p {
  margin: 0;
}

/* --- Section theming (semantic cascading) --- */

.section--darker {
  background-color: var(--background-10);
  --text: var(--text-10);
  --text-muted: var(--text-10-muted);
  --primary: var(--primary-10);
  --primary-muted: var(--primary-10-muted);
  --secondary: var(--secondary-10);
  --secondary-muted: var(--secondary-10-muted);
}

.section--dark {
  background-color: var(--background-20);
  --text: var(--text-20);
  --text-muted: var(--text-20-muted);
  --primary: var(--primary-20);
  --primary-muted: var(--primary-20-muted);
  --secondary: var(--secondary-20);
  --secondary-muted: var(--secondary-20-muted);
}

.section--light {
  background-color: var(--background-80);
  --text: var(--text-80);
  --text-muted: var(--text-80-muted);
  --primary: var(--primary-80);
  --primary-muted: var(--primary-80-muted);
  --secondary: var(--secondary-80);
  --secondary-muted: var(--secondary-80-muted);
}

.section--lighter {
  background-color: var(--background-90);
  --text: var(--text-90);
  --text-muted: var(--text-90-muted);
  --primary: var(--primary-90);
  --primary-muted: var(--primary-90-muted);
  --secondary: var(--secondary-90);
  --secondary-muted: var(--secondary-90-muted);
}

/* --- Typography --- */

/* Bare heading elements are styled as neutral safe defaults. Visible heading
   appearance is driven by the .kicker (h1/h2/h3) and .headline (p) classes,
   which separates semantic level from visual role. */
h1, h2, h3 {
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--size-hero); }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); font-weight: var(--weight-regular); }

/* Kicker — small uppercase label with primary-colour underline.
   Applied to h1/h2/h3 so the visually "small" label is the semantic heading,
   while the visually prominent descriptive text becomes a <p class="headline">. */
.kicker {
  display: inline-block;
  align-self: start;  /* prevents flex containers (e.g. hero) from stretching the kicker's box to full width */
  font-family: var(--font-heading);
  font-weight: var(--weight-extrabold);
  font-size: var(--size-kicker);
  line-height: var(--leading-relaxed);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text);
  box-shadow: inset 0 calc(-1 * var(--kicker-line-thickness)) 0 0 var(--primary);
  margin-bottom: var(--space-5);
}

/* Hidden keyword span inside a kicker heading. Lets the heading include
   SEO-relevant keywords (e.g. "AI Consultancy Australia") that remain in the
   DOM and accessibility tree but do not render visibly. Collapsed to zero
   width with overflow hidden — preferred over display:none because search
   engines discount content that is visually removed. */
.kicker .label {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Headline — the visually prominent descriptive statement paired with a kicker.
   Uses the same typographic treatment as a former <h2>, but lives in a <p>
   so the semantic heading level stays with the short kicker label above. */
.headline {
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: var(--size-h2);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-5);
}

/* Hero variant — larger size, wider max-width for the opening statement. */
.headline--hero {
  font-size: var(--size-hero);
  max-width: 56.25rem;
}

.deck {
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: var(--size-deck);
  line-height: var(--leading-normal);
  color: var(--text-muted);
  max-width: 45rem;
  margin-bottom: var(--space-5);
}

/* --- Section layout --- */

.section {
  padding: var(--padding-section-y) var(--padding-content-x);
  position: relative;
  width: 100%;
}

/* --- Header --- */

/* Suppress transitions on the mobile menu and scrim during viewport resize.
   Prevents a spurious slide-out animation when the breakpoint flips from
   desktop to mobile (where transform changes from none to translateX(100%)).
   The .is-resizing class is added and removed by scripts.js on resize.
   Selector mirrors the specificity of `.header .menu.menu--toggle .menu__panel`
   in the mobile @media block so this override wins the cascade. */
.is-resizing .header .menu.menu--toggle .menu__panel,
.is-resizing .header::before {
  transition: none;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: var(--background-20);
  padding: 0 var(--padding-chrome-x);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Semantic variable cascade — header is a dark context (matches hero) */
  --text: var(--text-20);
  --text-muted: var(--text-20-muted);
  --primary: var(--primary-20);
  --primary-muted: var(--primary-20-muted);
  --secondary: var(--secondary-20);
  --secondary-muted: var(--secondary-20-muted);
}

.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header__logo-img {
  max-height: var(--logo-height);
  width: auto;
}

/* Header context — primary menu rendered by nav/menu in `toggle` mode at the
 * tablet breakpoint. Visual presentation lives here; the menu component owns
 * the open/close state machine. The selectors below double up on the
 * `.menu--toggle` class to outweigh the component's default `display: none`
 * on .menu__panel — the header treats the panel as an always-rendered
 * slide-out (visible-but-translated-offscreen) rather than fully hidden. */
.header .menu {
  display: flex;
  align-items: center;
}

.header .menu.menu--toggle .menu__panel {
  display: flex;
  align-items: center;
}

.header .menu__list {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
  margin: 0;
  padding: 0;
}

.header .menu__list a:not(.button) {
  font-family: var(--font-body);
  font-size: var(--size-menu);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  transition: color var(--transition-default);
  white-space: nowrap;
}

.header .menu__list a:not(.button):hover {
  color: var(--text);
}

/* Items styled as buttons via the menu's `style:` map flow their classes
 * directly through to the <a> (e.g. `button button--primary button--small`),
 * so the canonical button rules apply unchanged. No header-specific button
 * styling needed here. */

/* Hamburger trigger — visible only when the toggle mode is active for the
 * configured breakpoint. The trigger contains three child <span>s that
 * render as horizontal bars and animate into an X on the checked state
 * (see the @media (max-width: 959px) block below). */
.header .menu__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 0.3125rem;
  cursor: pointer;
  padding: var(--space-2);
  z-index: 1003;
  position: relative;
}

.header .menu__toggle span {
  display: block;
  width: 1.375rem;
  height: 0.125rem;
  background-color: var(--text);
  border-radius: 0.0625rem;
  transition: transform var(--transition-slow), opacity var(--transition-slow);
}

/* --- Hero --- */

.section--hero {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--header-height) + var(--space-8));
  padding-bottom: var(--space-8);
}

.hero__cta {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

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

.hero__social a {
  color: var(--text-muted);
  transition: color var(--transition-default);
  display: flex;
  align-items: center;
}

.hero__social a:hover {
  color: var(--secondary);
}

/* Hero social icons render 15% larger than the default token sizes.
   Scoped to .hero__social so footer icons remain at their default size. */
.hero__social .brand-icon--sm {
  width: calc(var(--icon-size-sm) * 1.15);
  height: calc(var(--icon-size-sm) * 1.15);
}

.hero__social .brand-icon--md {
  width: calc(var(--icon-size-md) * 1.15);
  height: calc(var(--icon-size-md) * 1.15);
}

.hero__social .brand-icon--lg {
  width: calc(var(--icon-size-lg) * 1.15);
  height: calc(var(--icon-size-lg) * 1.15);
}

/* --- Buttons --- */

.button {
  display: inline-block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--size-button);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-none);
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  transition: background-color var(--transition-default), transform var(--transition-default);
  text-align: center;
}

.button--primary {
  background-color: var(--primary-muted);
  color: var(--text-10);
}

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

.button--small {
  padding: var(--space-2) var(--space-3);
}

/* --- Prose grid (ul of li text items) --- */

.prose-grid {
  list-style: none;
  padding: 0;
  margin: var(--space-6) 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.prose-grid li {
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
}

/* --- Item grid (ul of li > article.item) ---
   The grid wrapper is a <ul class="item-grid item-grid--<section>">.
   Each grid cell is an <li class="item-grid__cell"> with an
   <article class="item …"> inside.
   Item chrome (border, background, padding) is on .item--card; the base
   .item rule owns the always-applies layout (spacing between sub-elements,
   typography hooks). An item rendered with item_style: plain gets just
   .item — no card chrome. */

.item-grid {
  list-style: none;
  padding: 0;
  margin: var(--space-7) 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

/* Each grid cell is `display: grid` (single-cell) so the inner <article>
   stretches to fill the cell vertically. Without this, the cell stretches
   (default grid item behaviour) but the article inside shrinks to content
   height — producing visibly variable card heights in the same row. */
.item-grid__cell {
  display: grid;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Card chrome — only when the item is rendered with item_style: card. */
.item--card {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
}

/* Card backgrounds tied to the parent section's tone. */
.section--light .item--card {
  background-color: var(--background-90);
}
.section--lighter .item--card {
  background-color: var(--background-80);
}

.item__title {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: var(--size-card-title);
  line-height: 1.3;
  color: var(--text);
  margin: 0;
}

.item__desc {
  font-size: var(--size-body);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
  margin: 0;
}

/* Top-of-item icon — block-level so it sits on its own line, primary-coloured. */
.item .item__icon {
  display: block;
  color: var(--primary);
}

/* Item-element spacing: any two adjacent siblings inside the item get
   `--space-2` between them. Title directly followed by description
   tightens to `--space-1` instead. A single-element item gets no margins
   at all, because nothing precedes the lone child. */
.item > * + * {
  margin-top: var(--space-2);
}

.item > .item__title + .item__desc {
  margin-top: var(--space-1);
}

/* --- Centered section headers ---
   Every section other than the page hero centres its kicker, headline and
   deck. Headline and deck have wider max-widths than the tighter contact
   section so longer descriptive sentences read naturally on wide
   viewports. Cards and prose-grid items inside these sections reset to
   text-align: left so their internal content stays as written.
*/
.section:not(.section--hero) {
  text-align: center;
}

.section:not(.section--hero) .item,
.section:not(.section--hero) .prose-grid li {
  text-align: left;
}

.section:not(.section--hero) .headline,
.section:not(.section--hero) .deck {
  margin-left: auto;
  margin-right: auto;
}

.section:not(.section--hero) .headline {
  max-width: 56rem;
}

.section:not(.section--hero) .deck {
  max-width: 50rem;
}

/* --- Contact section --- */

.section--contact {
  text-align: center;
}

.section--contact .headline,
.section--contact .deck,
.section--contact .kicker {
  margin-left: auto;
  margin-right: auto;
}

.section--contact .headline {
  max-width: 43.75rem;
}

.section--contact .deck {
  max-width: 40rem;
}

.contact__email {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: var(--weight-medium);
  color: var(--text);
  transition: color var(--transition-default), border-color var(--transition-default);
  border-bottom: 0.0625rem solid rgba(184, 219, 232, 0.3);
  padding-bottom: var(--space-1);
}

.contact__email:hover {
  color: var(--secondary);
  border-bottom-color: var(--secondary);
}

/* --- Footer --- */

.footer {
  background-color: var(--background-10);
  color: var(--text-10-muted);
  padding: var(--padding-footer-top) var(--padding-chrome-x) var(--padding-footer-bottom);
  text-align: center;
  /* Semantic variable cascade — footer is the "darker" context (deepest dark), in contrast to the header and hero which use the "dark" context */
  --text: var(--text-10);
  --text-muted: var(--text-10-muted);
  --primary: var(--primary-10);
  --primary-muted: var(--primary-10-muted);
  --secondary: var(--secondary-10);
  --secondary-muted: var(--secondary-10-muted);
}

.footer__socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.footer__socials a {
  display: flex;
  align-items: center;
  color: var(--text-10-muted);
  transition: color var(--transition-default);
}

.footer__socials a:hover {
  color: var(--secondary-10);
}

.footer__socials a svg {
  display: block;
}

/* Footer-context menu (Home / About / Contact). Always visible — no toggle. */
.footer .menu__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-5);
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
}

.footer .menu__list a {
  font-family: var(--font-body);
  font-size: var(--size-small);
  color: var(--text-10-muted);
  transition: color var(--transition-default);
}

.footer .menu__list a:hover {
  color: var(--secondary-10);
}

/* --- Brand icons (SVG sprite references for socials etc.) --- */

.brand-icon {
  display: block;
  fill: currentColor;
}

.brand-icon--sm { width: var(--icon-size-sm); height: var(--icon-size-sm); }
.brand-icon--md { width: var(--icon-size-md); height: var(--icon-size-md); }
.brand-icon--lg { width: var(--icon-size-lg); height: var(--icon-size-lg); }

.footer__copy {
  font-size: var(--size-small);
  line-height: var(--leading-none);
  color: #5a6e80;
}

/* ============================================================
   Animation system
   ============================================================ */

.animate .section .kicker,
.animate .section .headline,
.animate .section .deck,
.animate .section .item,
.animate .section .prose-grid li {
  opacity: 0;
  transform: translateY(var(--anim-offset));
  transition:
    opacity var(--anim-duration) var(--anim-easing) var(--_delay, 0s),
    transform var(--anim-duration) var(--anim-easing) var(--_delay, 0s);
}

.animate .section .kicker   { --_delay: var(--anim-delay-1); }
.animate .section .headline { --_delay: var(--anim-delay-2); }
.animate .section .deck     { --_delay: var(--anim-delay-3); }

/* Items and prose-grid items both stagger in by --anim-stagger (80ms) per index */
.animate .section .item,
.animate .section .prose-grid li {
  --_delay: calc(
    var(--anim-delay-4) + (var(--_stagger-index, 0) * var(--anim-stagger))
  );
}

.animate .section.visible * {
  opacity: 1;
  transform: none;
}

/* Specific reveal rules matching the initial-hidden specificity for element-selector-based rules.
   Without these, the element selector in the initial-hidden rule beats the universal reveal. */
.animate .section.visible .prose-grid li {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Responsive -- Tablet +
   ============================================================ */
@media (min-width: 640px) {
  .prose-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-7);
  }

  /* Pillar listing grids — both the home page sections (services /
     industries / framework) and the corresponding pillar-page grids
     (engagements / sectors / models) share the same responsive layout. */
  .item-grid--services,
  .item-grid--engagements,
  .item-grid--industries,
  .item-grid--sectors,
  .item-grid--framework,
  .item-grid--models {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Pillar-page sub-section grids (framework section pages listing their
     own children — anatomy / methodology / disciplines / orchestration /
     reference and equivalents). Column count adapts to item count: 2 cols
     by default, 3 cols when the item count is divisible by 3 (so 3, 6
     and 9 items lay out cleanly with no partial trailing row), and a
     single centred card for the 1-item case. */
  .item-grid--pillars {
    grid-template-columns: repeat(2, 1fr);
  }
  .item-grid--pillars:has(> li:nth-child(3):last-child),
  .item-grid--pillars:has(> li:nth-child(6):last-child),
  .item-grid--pillars:has(> li:nth-child(9):last-child) {
    grid-template-columns: repeat(3, 1fr);
  }
  .item-grid--pillars:has(> li:only-child) {
    grid-template-columns: minmax(auto, 28rem);
    justify-content: center;
  }

  /* Book listings (the home page literature section and the books-page
     volumes section) hold three items today and render best at 3 cols
     rather than 2+1. Tablet and up. */
  .item-grid--literature,
  .item-grid--volumes {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact__links {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-7);
  }
}

/* ============================================================
   Responsive -- Tablet compact chrome (640–959px)
   Makes nav items and header slightly smaller in portrait tablets.
   ============================================================ */
@media (min-width: 640px) and (max-width: 959px) {
  :root {
    --size-menu: 0.9375rem;
    --header-height: 3.75rem;
  }
}

/* ============================================================
   Responsive -- Desktop
   ============================================================ */
@media (min-width: 960px) {
  .item-grid--services,
  .item-grid--engagements,
  .item-grid--industries,
  .item-grid--sectors,
  .item-grid--framework,
  .item-grid--models {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ============================================================
   Responsive -- Hamburger menu (mobile + tablet portrait, up to 959px)
   Inline menu has too little room below this width, so the header
   collapses into a hamburger + slide-out menu at both tablet-portrait
   and phone widths.
   ============================================================ */
@media (max-width: 959px) {
  .header .menu__toggle {
    display: flex;
  }

  /* Slide-out panel — visible-but-translated-offscreen, slides in on toggle.
   * Selector doubles up `.menu--toggle` to outweigh the component's default
   * `.menu--toggle .menu__panel { display: none }`. */
  .header .menu.menu--toggle .menu__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 16.25rem;
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    background-color: var(--background-20);
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    z-index: 1002;
    display: flex;
  }

  .header .menu__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  /* The <li> is the flex item now (in the original markup the <a> was). For
   * non-button items it stretches full width; the item containing the
   * button shrinks to content and aligns to the start with extra top margin
   * to mirror the original `.header__menu .button` rule. */
  .header .menu__list li {
    width: 100%;
  }

  .header .menu__list li:has(.button) {
    width: auto;
    align-self: flex-start;
    margin-top: var(--space-4);
  }

  .header .menu__list a:not(.button) {
    display: block;
    font-size: var(--size-body);
    padding: var(--space-3) 0;
    color: var(--text-muted);
    width: 100%;
    border-bottom: 0.0625rem solid rgba(184, 219, 232, 0.12);
  }

  .header .menu .menu__toggle-input:checked ~ .menu__panel {
    transform: translateX(0);
  }

  /* Animate hamburger → X. Top and bottom lines rotate; middle line fades. */
  .header .menu .menu__toggle-input:checked ~ .menu__toggle span:nth-child(1) {
    transform: rotate(45deg) translate(0.3125rem, 0.3125rem);
  }

  .header .menu .menu__toggle-input:checked ~ .menu__toggle span:nth-child(2) {
    opacity: 0;
  }

  .header .menu .menu__toggle-input:checked ~ .menu__toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(0.3125rem, -0.3125rem);
  }

  /* Scrim behind the slide-out menu. */
  .header::before {
    content: '';
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    z-index: 1001;
  }

  .header:has(.menu__toggle-input:checked)::before {
    opacity: 1;
  }
}

/* Above 960px, the header menu is inline (toggle hidden, panel shown). The
 * menu component's `.menu--collapse-tablet` modifier already hides the
 * toggle at 960+ — we keep the panel inline-flex here to lay items out
 * horizontally and override the slide-out positioning that would otherwise
 * leak from the mobile rules above. */
@media (min-width: 960px) {
  .header .menu.menu--toggle .menu__panel {
    position: static;
    transform: none;
    transition: none;
    display: flex;
    background: transparent;
    padding: 0;
    width: auto;
  }
  .header .menu__list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-5);
  }
}

/* ============================================================
   Responsive -- Mobile-specific (phone-only, up to 639px)
   Mobile-only adjustments: tighter edge padding, full-size touch
   targets for compact buttons, hero CTA gap.
   ============================================================ */
@media (max-width: 639px) {
  :root {
    /* On phone screens, use a fixed horizontal padding for all containers.
       Header, footer and content sections all share the same edge distance. */
    --padding-content-x: 1.25rem;
    --padding-chrome-x: 1.25rem;
  }

  /* Compact buttons (.button--small) are a desktop density modifier.
     On phone screens, touch targets need to be larger (44–48px minimum),
     so the small modifier is nullified — small buttons render at full size. */
  .button--small {
    padding: var(--space-3) var(--space-5);
    font-size: var(--size-button);
  }

  .hero__cta {
    gap: var(--space-5);
  }
}


/* ============================================================
   Article-page layout
   Used by chapter pages, book overview pages and the literature hub.
   <main class="main main--article">
     <section.section--hero-article>
     <article.prose>
     <ul.listing>?
     <aside.aside--meta>?
     <aside.aside--toc>?
     <section.section--contact>
   The article and listing flow in the main column; asides occupy a sticky
   right rail. Hero and contact span the full width.
   ============================================================ */

.main--article {
  display: block;
}

@media (min-width: 960px) {
  .main--article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    column-gap: var(--space-8);
    align-items: start;
  }
  .main--article > .section--hero-article,
  .main--article > .section--contact,
  .main--article > .listing {
    grid-column: 1 / -1;
  }
  .main--article > .prose {
    grid-column: 1;
  }
  .main--article > .aside {
    grid-column: 2;
    position: sticky;
    top: calc(var(--header-height, 64px) + var(--space-5));
    align-self: start;
    margin-top: var(--space-7);
  }
  .main--article > .aside + .aside {
    margin-top: var(--space-5);
  }
}

/* Article hero — slimmer than the pillar hero, no globe, breadcrumbs above. */
.section--hero-article {
  padding-block: var(--space-7) var(--space-8);
}
.section--hero-article .kicker {
  font-size: var(--size-kicker, 0.875rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.section--hero-article .headline--article {
  font-size: clamp(2rem, 1rem + 2.5vw, 3.25rem);
  line-height: 1.15;
  margin-bottom: var(--space-5);
}
.section--hero-article .deck {
  max-width: 56ch;
}

/* Breadcrumbs — use the section's muted text colour so the trail reads
   clearly against any background tone without blending in. */
.breadcrumbs {
  font-size: 0.875rem;
  margin-bottom: var(--space-5);
  color: var(--text-muted);
}
.breadcrumbs__link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.breadcrumbs__link:hover {
  border-bottom-color: currentColor;
}
.breadcrumbs__sep {
  margin: 0 var(--space-2);
  opacity: 0.5;
}
.breadcrumbs__current {
  font-weight: 500;
}

/* Article prose body */
.prose {
  padding-block: var(--space-7) var(--space-8);
  padding-inline: var(--padding-content-x);
  max-width: 72ch;
  font-size: var(--size-body, 1.0625rem);
  line-height: 1.7;
}
.prose > * + * {
  margin-top: var(--space-5);
}
.prose h2 {
  font-size: clamp(1.375rem, 0.75rem + 1.5vw, 1.875rem);
  line-height: 1.25;
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
  font-weight: 600;
}
.prose h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
  font-weight: 600;
}
.prose p {
  margin: 0;
}
.prose ul, .prose ol {
  padding-left: 1.5em;
}
.prose li + li {
  margin-top: var(--space-3);
}
.prose blockquote {
  border-left: 3px solid var(--color-accent, currentColor);
  padding-left: var(--space-5);
  font-style: italic;
  opacity: 0.85;
}
.prose strong { font-weight: 600; }
.prose a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

/* Asides — meta and TOC */
.aside {
  padding: var(--space-5);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.025);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.aside__title {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 var(--space-4);
  opacity: 0.7;
}
.aside__list {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-4);
  row-gap: var(--space-2);
  margin: 0;
}
.aside__list dt {
  font-weight: 500;
  opacity: 0.7;
}
.aside__list dd {
  margin: 0;
}
.aside__toc {
  margin: 0;
  padding-left: 1.25em;
}
.aside__toc__item {
  margin-block: var(--space-2);
}
.aside__toc__item a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.aside__toc__item a:hover {
  border-bottom-color: currentColor;
}
.aside__toc__item--sub {
  padding-left: var(--space-4);
  font-size: 0.875rem;
  opacity: 0.85;
}

/* Single-column listings — books pillar, chapters under a book overview,
   and the literature section on the home page. Each book / chapter is a
   substantial item that benefits from full-width display. */
/* Chapter listings stay full-width single column (each chapter is a
   substantial entry that benefits from full-width display). Books and
   literature collections render multi-column — see the responsive rule
   below. */
.item-grid--chapters {
  grid-template-columns: 1fr;
}
.item__title a {
  color: inherit;
  text-decoration: none;
}
.item__title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* When a markdown link in an item title routes through the link component
   (`<h3 class="item__title"><a class="link">…</a></h3>`), suppress the
   body-link styling so the title still reads as a heading rather than a
   middle-of-paragraph hyperlink. Underline returns on hover to match the
   plain `.item__title a:hover` rule. */
.item__title .link {
  color: inherit;
}
.item__title .link__text {
  font-weight: inherit;
  text-decoration: none;
}
.item__title .link:hover .link__text {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
