/* ==========================================================================
   CometX — motion, marquees and social
   --------------------------------------------------------------------------
   Loaded on every page, after site.css. Adds movement, tickers, animated
   figures and the social row, using the site's own tokens.

   Every animation here is opt-out: `prefers-reduced-motion: reduce` stops all
   of it, marquees pause on hover and on keyboard focus, and nothing that
   carries meaning depends on movement to be readable.
   ========================================================================== */

/* ==========================================================================
   1. Scroll reveal — extends the existing data-reveal hook
   ========================================================================== */
/* Reveals that slide in horizontally overhang the viewport for a few hundred
   milliseconds. Clipping on the root stops that becoming a scrollbar without
   creating a new scroll container the way overflow:hidden would. */
html { overflow-x: clip; }
@supports not (overflow: clip) { html { overflow-x: hidden; } }

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.22, .68, .32, 1),
              transform .7s cubic-bezier(.22, .68, .32, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }
.reveal-off [data-reveal] { opacity: 1; transform: none; }

/* Reveals that slide in horizontally overhang the viewport for a few hundred
   milliseconds. Clipping on the root stops that becoming a scrollbar without
   creating a new scroll container the way overflow:hidden would. */
html { overflow-x: clip; }
@supports not (overflow: clip) { html { overflow-x: hidden; } }

/* Direction variants */
[data-reveal="left"]  { transform: translateX(-26px); }
[data-reveal="right"] { transform: translateX(26px); }
[data-reveal="scale"] { transform: scale(.965); }
[data-reveal="left"].is-in,
[data-reveal="right"].is-in,
[data-reveal="scale"].is-in { transform: none; }

/* ==========================================================================
   2. Marquee / ticker
   ========================================================================== */
.marquee {
  --marquee-duration: 42s;
  position: relative;
  overflow: hidden;
  display: flex;
  user-select: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6rem, #000 calc(100% - 6rem), transparent);
          mask-image: linear-gradient(to right, transparent, #000 6rem, #000 calc(100% - 6rem), transparent);
}
.marquee__track {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--marquee-gap, 2.5rem);
  padding-right: var(--marquee-gap, 2.5rem);
  min-width: 100%;
  animation: marquee-run var(--marquee-duration) linear infinite;
  will-change: transform;
}
.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track { animation-play-state: paused; }
.marquee--reverse .marquee__track { animation-direction: reverse; }
.marquee--slow { --marquee-duration: 64s; }
@keyframes marquee-run { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Word ticker — the CometX practices / topics strip */
.marquee--words { padding-block: .9rem; border-block: 1px solid var(--line); background: var(--white); }
.marquee--words .marquee__item {
  font-family: "IBM Plex Mono", monospace;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--slate);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: .75rem;
}
.marquee--words .marquee__item::after {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--band, var(--accent));
  flex: none;
}
.section--ink .marquee--words { background: transparent; border-color: rgba(255,255,255,.16); }
.section--ink .marquee--words .marquee__item { color: #C6D2E2; }

/* Chip marquee — linked topics */
.marquee--chips { padding-block: 1.1rem; }
.marquee__chip {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: .95rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .6rem 1.15rem;
  transition: border-color .18s ease, color .18s ease, transform .18s ease;
}
.marquee__chip:hover {
  border-color: var(--band, var(--accent));
  color: var(--band, var(--accent));
  transform: translateY(-2px);
}

/* Marquee is decoration; hide the duplicated half from assistive tech. */
.marquee__track[aria-hidden="true"] { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; overflow-x: auto; }
  .marquee__track { animation: none; }
  .marquee__track[aria-hidden="true"] { display: none; }
}

/* ==========================================================================
   3. Animated counters
   ========================================================================== */
.count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ==========================================================================
   4. Hover and micro-interaction
   ========================================================================== */
a.card, .lib-card, .res-card, .bh-card {
  transition: transform .22s cubic-bezier(.22,.68,.32,1), box-shadow .22s ease;
}
.btn, .btn-ghost { transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease; }

/* Underline that draws in */
.link-draw {
  position: relative;
  text-decoration: none;
  color: var(--band, var(--accent));
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
}
.link-draw::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .28s cubic-bezier(.22,.68,.32,1);
}
.link-draw:hover::after, .link-draw:focus-visible::after { transform: scaleX(1); }

/* The spectrum strip drifts very slowly, purely ambient */
@media (prefers-reduced-motion: no-preference) {
  .spectrum i { animation: band-in 1.1s cubic-bezier(.22,.68,.32,1) both; }
}

/* Figures lift slightly on hover */
.figure img { transition: transform .9s cubic-bezier(.22,.68,.32,1); }
.figure:hover img { transform: scale(1.035); }

/* ==========================================================================
   5. Social row (footer, every page)
   ========================================================================== */
.social {
  display: flex;
  gap: .6rem;
  margin-top: 1.1rem;
  padding: 0;
  list-style: none;
}
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28);
  color: #DCE5F1;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.social a:hover, .social a:focus-visible {
  background: var(--white);
  border-color: var(--white);
  color: var(--ink);
  transform: translateY(-2px);
  text-decoration: none;
}
.social svg { width: 18px; height: 18px; fill: currentColor; display: block; }

/* ==========================================================================
   6. Built Here
   ========================================================================== */
.bh-hero { background: var(--ink); color: #E6ECF5; position: relative; overflow: hidden; }
.bh-hero::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(58% 68% at 80% 16%, rgba(163,104,22,.34), transparent 66%),
              radial-gradient(46% 56% at 10% 92%, rgba(18,128,149,.26), transparent 70%);
}
.bh-hero > * { position: relative; z-index: 2; }
.bh-hero h1 { color: var(--white); max-width: 16ch; }
.bh-hero h1 em { font-style: normal; color: #E9B872; }
.bh-hero .lede { color: #C6D2E2; max-width: 56ch; }
.bh-hero .eyebrow { color: #C7A87E; }

.bh-punch {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600;
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0 0 1.1rem;
  color: var(--white);
}
.bh-punch span { color: #E9B872; }

/* The Built Here hero is a dark panel, so buttons need the ink treatment that
   site.css gives .section--ink. Without this the ghost button is ink-on-ink. */
.bh-hero .btn { background: var(--white); color: var(--ink); }
.bh-hero .btn:hover { background: #E9B872; color: var(--ink); }
.bh-hero .btn-ghost { color: var(--white); border-color: rgba(255,255,255,.42); }
.bh-hero .btn-ghost:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.bh-hero .hero-figures { border-top-color: rgba(255,255,255,.18); }
.bh-hero .hero-figures dt { color: #C7A87E; }
.bh-hero .hero-figures dd { color: var(--white); }

/* A form placed on a dark section: site.css colours labels and hints for a
   light background, so they have to be lifted here. */
.section--ink .field label,
.section--ink .field .field-legend,
.section--ink fieldset.field legend { color: #C7A87E; }
.section--ink .field-hint { color: #A9BBD2; }
.section--ink .field-hint a,
.section--ink .ticks li,
.section--ink .bh-punch + p { color: #DCE5F1; }
.section--ink .field-hint a { text-decoration: underline; }
.section--ink .field-hint a:hover { color: var(--white); }

.bh-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.bh-card {
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden; position: relative;
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
}
.bh-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--band, var(--b-amber)); z-index: 3;
}
.bh-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.bh-card__media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--frost); }
.bh-card__media img { width: 100%; height: 100%; object-fit: cover; }
.bh-card__body { padding: 1.35rem 1.4rem 1.5rem; flex: 1 1 auto; }
.bh-card__meta {
  font-family: "IBM Plex Mono", monospace; font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--band, var(--b-amber));
  display: block; margin-bottom: .55rem;
}
.bh-card h3 { font-size: 1.2rem; line-height: 1.18; margin: 0 0 .5rem; }
.bh-card p { font-size: .95rem; line-height: 1.55; color: var(--slate); margin: 0; }

/* Pull quote inside a story */
.bh-quote {
  border-left: 3px solid var(--band, var(--b-amber));
  padding: .35rem 0 .35rem 1.6rem;
  margin: 2rem 0;
}
.bh-quote p {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 500; letter-spacing: -.02em; line-height: 1.35;
  color: var(--ink); margin: 0 0 .6rem;
}
.bh-quote cite {
  font-family: "IBM Plex Mono", monospace; font-size: .72rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--slate); font-style: normal;
}

/* Editorial note — marks material that still needs the interview */
.bh-note {
  border: 1px dashed var(--b-amber);
  background: #FDF7EE;
  border-radius: 4px;
  padding: 1.1rem 1.25rem;
  font-size: .92rem;
  line-height: 1.6;
  color: #5C4212;
}
.bh-note strong { color: #3F2D0B; }

/* Numbered process steps */
.steps { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.25rem; }
@media (min-width: 780px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { position: relative; padding-top: 1.1rem; border-top: 2px solid var(--band, var(--accent)); }
.steps .n {
  font-family: "IBM Plex Mono", monospace; font-size: .72rem; letter-spacing: .14em;
  color: var(--band, var(--accent)); display: block; margin-bottom: .5rem;
}
.steps h3 { font-size: 1.05rem; margin: 0 0 .35rem; }
.steps p { font-size: .92rem; color: var(--slate); margin: 0; line-height: 1.55; }

/* ==========================================================================
   7. Request-a-copy row (replaces the PDF buttons)
   ========================================================================== */
.request-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.request-note {
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--slate);
}

@media print {
  .marquee, .social { display: none !important; }
  /* Reveals that slide in horizontally overhang the viewport for a few hundred
   milliseconds. Clipping on the root stops that becoming a scrollbar without
   creating a new scroll container the way overflow:hidden would. */
html { overflow-x: clip; }
@supports not (overflow: clip) { html { overflow-x: hidden; } }

[data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
   8. Further motion
   Added across the site. All of it sits inside the reduced-motion guard at the
   foot of this file, and none of it is required to read or operate anything.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {

  /* --- Headline entrance ------------------------------------------------ */
  .page-hero h1, .bh-hero h1, .hero h1 {
    animation: rise-in .85s cubic-bezier(.22,.68,.32,1) both;
  }
  .page-hero .lede, .bh-hero .lede, .hero .lede {
    animation: rise-in .85s cubic-bezier(.22,.68,.32,1) .1s both;
  }
  .page-hero .btn-row, .bh-hero .btn-row, .hero .btn-row {
    animation: rise-in .85s cubic-bezier(.22,.68,.32,1) .2s both;
  }
  .page-hero .eyebrow, .bh-hero .eyebrow, .hero .eyebrow {
    animation: rise-in .7s cubic-bezier(.22,.68,.32,1) both;
  }
  @keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

  /* --- The eyebrow rule draws itself out -------------------------------- */
  .eyebrow-mark::before { animation: rule-draw .8s cubic-bezier(.22,.68,.32,1) .15s both; }
  @keyframes rule-draw { from { width: 0; } to { width: 22px; } }

  /* --- Spectrum bands drop in ------------------------------------------- */
  @keyframes band-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
  .spectrum i { transform-origin: top; }
  .spectrum i:nth-child(1) { animation-delay: 0ms; }
  .spectrum i:nth-child(2) { animation-delay: 70ms; }
  .spectrum i:nth-child(3) { animation-delay: 140ms; }
  .spectrum i:nth-child(4) { animation-delay: 210ms; }
  .spectrum i:nth-child(5) { animation-delay: 280ms; }

  /* --- Cards: band grows, content lifts --------------------------------- */
  .card::before, .lib-card::before, .bh-card::before {
    transition: transform .3s cubic-bezier(.22,.68,.32,1);
    transform-origin: left;
  }
  .card:hover::before, .lib-card:hover::before, .bh-card:hover::before { transform: scaleX(1.0); }
  a.card:hover, .card:hover { transform: translateY(-3px); }

  /* --- Buttons ---------------------------------------------------------- */
  .btn:hover, .btn-ghost:hover { transform: translateY(-2px); }
  .btn:active, .btn-ghost:active { transform: translateY(0); }

  /* --- Numbered steps count in ------------------------------------------ */
  .steps li { transition: border-color .3s ease; }
  .steps li:hover { border-color: var(--ink); }
  .steps .n { transition: letter-spacing .3s ease; }
  .steps li:hover .n { letter-spacing: .22em; }

  /* --- Ticks stagger ---------------------------------------------------- */
  [data-reveal].is-in .ticks li { animation: tick-in .5s cubic-bezier(.22,.68,.32,1) both; }
  .ticks li:nth-child(1) { animation-delay: .05s; }
  .ticks li:nth-child(2) { animation-delay: .12s; }
  .ticks li:nth-child(3) { animation-delay: .19s; }
  .ticks li:nth-child(4) { animation-delay: .26s; }
  @keyframes tick-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

  /* --- Table rows ------------------------------------------------------- */
  .rpt table tbody tr { transition: background .2s ease; }
  .rpt table tbody tr:hover { background: var(--frost); }

  /* --- Footer links ----------------------------------------------------- */
  .site-footer ul a { display: inline-block; transition: transform .2s ease, color .2s ease; }
  .site-footer ul a:hover { transform: translateX(3px); }

  /* --- Nav underline ---------------------------------------------------- */
  .nav a { position: relative; }
  .nav a::after {
    content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .25rem;
    height: 1.5px; background: currentColor; transform: scaleX(0);
    transform-origin: left; transition: transform .26s cubic-bezier(.22,.68,.32,1);
  }
  .nav a:hover::after { transform: scaleX(1); }
  .nav a[aria-current="page"]::after { display: none; }

  /* --- Blockquote bar --------------------------------------------------- */
  .bh-quote { transition: border-color .3s ease; }
  .bh-quote:hover { border-color: var(--ink); }

  /* --- Report figures fade up ------------------------------------------- */
  .rpt .figure { transition: box-shadow .3s ease; }
  .rpt .figure:hover { box-shadow: var(--shadow-md); }
}

/* ==========================================================================
   9. The masthead comet mark
   The brand logo in the header reacts to hover: the head darts forward and the
   spectral tail streaks behind it, then settles. Idle it breathes very
   slightly, so the mark feels alive without ever demanding attention.
   ========================================================================== */
.brand svg { overflow: visible; }
.brand svg circle { transform-origin: 27px 13px; }
.brand svg path { transform-origin: 20px 20px; }
/* Anchored to the mark, not the whole lockup: the lockup is wider in French,
   and a percentage inset there pushed the glow past the viewport edge. */
.brand__glow {
  position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 66px; height: 66px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(91,75,214,.30), transparent 70%);
  opacity: 0; transition: opacity .45s ease; pointer-events: none;
}
.brand { position: relative; }

@media (prefers-reduced-motion: no-preference) {
  .brand svg circle { animation: brand-breathe 5.5s ease-in-out infinite; }
  @keyframes brand-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.07); }
  }

  .brand:hover svg circle,
  .brand:focus-visible svg circle { animation: brand-dart .8s cubic-bezier(.22,.68,.32,1); }
  .brand:hover svg path:nth-of-type(1) { animation: brand-streak .8s ease-out; }
  .brand:hover svg path:nth-of-type(2) { animation: brand-streak .8s ease-out .07s; }
  .brand:hover svg path:nth-of-type(3) { animation: brand-streak .8s ease-out .14s; }
  .brand:hover .brand__glow { opacity: 1; }

  @keyframes brand-dart {
    0%   { transform: translate(0,0) scale(1); }
    35%  { transform: translate(3px,-3px) scale(1.16); }
    100% { transform: translate(0,0) scale(1); }
  }
  @keyframes brand-streak {
    0%   { transform: translate(0,0); opacity: 1; }
    40%  { transform: translate(-4px,4px); opacity: .4; }
    100% { transform: translate(0,0); opacity: 1; }
  }

  /* The wordmark shifts a hair, so the whole lockup feels connected. */
  .brand b { display: inline-block; transition: transform .35s cubic-bezier(.22,.68,.32,1); }
  .brand:hover b { transform: translateX(2px); }

  /* Footer mark gets the same treatment at rest. */
  .site-footer .brand svg circle { animation-duration: 7s; }
}

/* ==========================================================================
   10. Image descriptions
   Every content image carries a visible written description underneath, in
   addition to its alt text. Sighted readers get the context; screen-reader
   users get the alt. The two are written to complement, not duplicate.
   ========================================================================== */
.img-desc {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: .68rem;
  letter-spacing: .07em;
  line-height: 1.55;
  text-transform: none;
  color: var(--slate);
  margin-top: .6rem;
}
.lib-card .img-desc, .bh-card .img-desc {
  padding: .6rem 1.4rem 0;
  margin-top: 0;
  border-top: 1px solid var(--line);
}
.section--ink .img-desc, .bh-hero .img-desc { color: #A9BBD2; }

/* ==========================================================================
   11. Reduced motion — a gentle exception
   --------------------------------------------------------------------------
   site.css kills every animation and transition when the visitor asks for
   reduced motion. That is a safe default, but stricter than the guidance
   requires: what reduce-motion exists to prevent is *movement* — sliding,
   parallax, spinning, zooming — because that is what triggers vestibular
   discomfort. A cross-fade has no movement in it.

   So under reduced motion we keep a short opacity fade and drop every
   transform. Nothing slides, nothing loops, nothing moves; content still
   arrives softly instead of snapping in.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  /* site.css sets `[data-reveal] { opacity: 1 !important }` here, so this needs
     both !important and a higher-specificity selector to take precedence. */
  html:not(.reveal-off) [data-reveal] {
    opacity: 0 !important;
    transform: none !important;
    transition: opacity .3s linear !important;
    transition-delay: 0ms !important;
  }
  html:not(.reveal-off) [data-reveal].is-in { opacity: 1 !important; }
  .reveal-off [data-reveal] { opacity: 1 !important; }

  /* Hover feedback stays, as colour only. */
  .lib-card, .res-card, .bh-card, a.card {
    transition: box-shadow .2s linear !important;
    transform: none !important;
  }
  .lib-card:hover, .res-card:hover, .bh-card:hover, a.card:hover {
    transform: none !important;
    box-shadow: var(--shadow-md);
  }

  /* Marquees hold still and become a plain scrollable row. */
  .marquee__track { animation: none !important; }
}

/* ==========================================================================
   12. Image descriptions inside a photo caption
   --------------------------------------------------------------------------
   .g-cell figcaption is white text on a dark scrim over the photograph. The
   description line added beneath the label inherited --slate (#4E6480), which
   is dark blue-grey on near-black — effectively invisible. It also made the
   caption two lines tall, pushing text up into the part of the scrim that
   fades to transparent, so on a bright photograph even the white label became
   hard to read.

   Both are fixed here: a light colour for the description, and a scrim that
   stays opaque across the whole caption rather than only at its foot.
   ========================================================================== */
.g-cell figcaption {
  background: linear-gradient(to top,
              rgba(12, 26, 46, .95) 0%,
              rgba(12, 26, 46, .92) 45%,
              rgba(12, 26, 46, .78) 72%,
              rgba(12, 26, 46, .30) 90%,
              rgba(12, 26, 46, 0) 100%) !important;
  padding-top: 3.2rem !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
}
.g-cell figcaption .img-desc {
  color: #DCE5F1;
  text-transform: none;
  letter-spacing: .04em;
  font-size: .66rem;
  line-height: 1.5;
  margin-top: .35rem;
  opacity: .95;
}

/* The same problem anywhere a description sits on a dark surface. */
.section--ink .img-desc,
.bh-hero .img-desc,
[data-dark] .img-desc,
.rpt [data-dark] .img-desc { color: #C6D2E2; }

/* ==========================================================================
   13. Components placed on a dark section
   --------------------------------------------------------------------------
   .callout and .hero-figures were written for light backgrounds. Dropped into
   .section--ink they keep their light surface colours and the text disappears.
   These give them a dark-surface variant rather than banning the combination.
   ========================================================================== */
.section--ink .callout {
  background: rgba(255, 255, 255, .07);
  border-left-color: var(--band, #E9B872);
}
.section--ink .callout h3 { color: #FFFFFF; }
.section--ink .callout p,
.section--ink .callout li,
.section--ink .ticks li { color: #C6D2E2; }
.section--ink .callout a,
.section--ink p a,
.section--ink li a,
.section--ink .check a,
.section--ink label a { color: #E9B872; text-decoration: underline; }
.section--ink .callout a:hover,
.section--ink p a:hover,
.section--ink li a:hover { color: #FFFFFF; }

/* hero-figures on a light page hero: site.css tints these for a dark hero. */
.page-hero .hero-figures dt { color: var(--slate); }
.page-hero .hero-figures dd { color: var(--ink-soft); }

/* Plain list used inside site-map cards */
.cx-list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.cx-list li { font-size: .93rem; line-height: 1.45; }
.cx-list a { font-weight: 600; }
.cx-list .cx-dim { color: var(--slate); font-size: .82rem; }

/* A .card dropped onto .section--ink keeps its light surface and loses its
   text. Give it a dark-surface variant rather than banning the combination. */
.section--ink .card {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
}
.section--ink .card h3 { color: #FFFFFF; }
.section--ink .card p { color: #C6D2E2; }
/* The spectrum bands are chosen for a light page and are too dark on an ink
   card. Lighten each one toward white so the colour coding survives while the
   text stays readable. */
.section--ink .card .card-index,
.section--ink .card .card-more {
  color: #E9B872;
  color: color-mix(in srgb, var(--band, #E9B872) 48%, #FFFFFF);
}
.section--ink a.card:hover { border-color: var(--band, #E9B872); }

/* ==========================================================================
   14. Language switch
   ========================================================================== */
.lang-switch {
  display: inline-flex;
  flex: 0 0 auto;
  order: 99;
  margin-left: 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
  font-family: "IBM Plex Mono", monospace;
  font-size: .66rem;
  letter-spacing: .1em;
}
.lang-switch a {
  padding: .32rem .6rem;
  color: var(--slate);
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}
.lang-switch a + a { border-left: 1px solid var(--line); }
.lang-switch a:hover { background: var(--frost); color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: #fff; }

/* Ten nav items plus a language switch is tight at laptop widths. Let the bar
   breathe rather than letting anything overlap. */
.header-inner { flex-wrap: wrap; row-gap: .35rem; }
.nav { flex: 1 1 auto; justify-content: flex-end; }
@media (min-width: 881px) and (max-width: 1280px) {
  .nav-top { padding: .5rem .5rem; font-size: .89rem; }
  .brand-text span { display: none; }
}
@media (min-width: 881px) and (max-width: 1080px) {
  .nav-top { padding: .5rem .38rem; font-size: .84rem; }
}
@media (max-width: 880px) {
  .lang-switch { order: 2; margin-left: auto; margin-right: .6rem; }
  .nav-toggle { order: 3; }
  .nav { order: 4; }
}

/* ==========================================================================
   15. The CometX Method
   ========================================================================== */
.method-hero .method-rail { display: flex; gap: 6px; margin-top: 2rem; max-width: 520px; }
.method-hero .method-rail span {
  flex: 1; height: 5px; border-radius: 3px; background: var(--band);
  transform-origin: left;
}
@media (prefers-reduced-motion: no-preference) {
  .method-hero .method-rail span { animation: rail-fill 1s cubic-bezier(.22,.68,.32,1) both; }
  .method-hero .method-rail span:nth-child(2) { animation-delay: .18s; }
  .method-hero .method-rail span:nth-child(3) { animation-delay: .36s; }
  .method-hero .method-rail span:nth-child(4) { animation-delay: .54s; }
  @keyframes rail-fill { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
}
.method-card .method-line {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 600; font-size: 1.02rem; color: var(--ink);
  letter-spacing: -.01em; margin: 0 0 .9rem;
}
.method-card .method-note {
  font-size: .9rem; line-height: 1.6; color: var(--slate);
  border-top: 1px solid var(--line); padding-top: .9rem; margin: 1rem 0 0;
}

/* ==========================================================================
   16. Ambient loops
   --------------------------------------------------------------------------
   Slow, continuous, low-contrast background motion. Nothing here carries
   meaning, nothing competes with text, and all of it stops under
   prefers-reduced-motion.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {

  /* A drifting field of light behind dark sections. */
  .section--ink, .bh-hero { position: relative; overflow: hidden; isolation: isolate; }
  .section--ink::before, .bh-hero::before {
    content: ""; position: absolute; inset: -30%; z-index: 0; pointer-events: none;
    background:
      radial-gradient(38% 42% at 22% 30%, rgba(91,75,214,.20), transparent 62%),
      radial-gradient(34% 38% at 78% 68%, rgba(18,128,149,.18), transparent 62%),
      radial-gradient(30% 34% at 55% 12%, rgba(163,104,22,.14), transparent 62%);
    animation: aurora 34s ease-in-out infinite alternate;
    will-change: transform;
  }
  .section--ink > *, .bh-hero > * { position: relative; z-index: 1; }
  @keyframes aurora {
    0%   { transform: translate3d(-2%, -1%, 0) scale(1);    }
    50%  { transform: translate3d( 2%,  2%, 0) scale(1.06); }
    100% { transform: translate3d(-1%,  1%, 0) scale(1.02); }
  }

  /* The spectrum strip breathes, very slowly. */
  .spectrum i { animation: band-in 1.1s cubic-bezier(.22,.68,.32,1) both,
                           band-breathe 12s ease-in-out infinite; }
  @keyframes band-breathe {
    0%, 100% { opacity: 1; }
    50%      { opacity: .72; }
  }

  /* Page heroes carry a slow, almost invisible wash. */
  .page-hero { position: relative; overflow: hidden; }
  .page-hero::after {
    content: ""; position: absolute; inset: -40% -20%; z-index: 0; pointer-events: none;
    background: radial-gradient(28% 34% at 30% 40%,
                color-mix(in srgb, var(--band, var(--accent)) 12%, transparent), transparent 70%);
    animation: wash 40s ease-in-out infinite alternate;
  }
  .page-hero > * { position: relative; z-index: 1; }
  @keyframes wash {
    0%   { transform: translate3d(0,0,0)      scale(1);    opacity: .75; }
    100% { transform: translate3d(6%, -4%, 0) scale(1.14); opacity: 1;   }
  }

  /* Eyebrow rules pulse gently once the page has settled. */
  .eyebrow-mark::before { animation: rule-draw .8s cubic-bezier(.22,.68,.32,1) .15s both,
                                     rule-glow 9s ease-in-out 2s infinite; }
  @keyframes rule-glow {
    0%, 100% { opacity: 1; }
    50%      { opacity: .55; }
  }

  /* Card top-bands drift through their own colour, barely perceptibly. */
  .card::before, .lib-card::before, .bh-card::before {
    animation: band-shift 14s ease-in-out infinite;
  }
  @keyframes band-shift {
    0%, 100% { filter: saturate(1)    brightness(1);    }
    50%      { filter: saturate(1.25) brightness(1.12); }
  }
}

/* ==========================================================================
   17. Grouped navigation with submenus
   Five top-level menus instead of eleven flat links. Opens on hover for a
   mouse, on click or Enter for keyboard and touch, and collapses to a plain
   expanding list on small screens.
   ========================================================================== */
.nav { position: relative; align-items: center; gap: .1rem; }
.nav-group { position: relative; }

.nav-top {
  display: inline-flex; align-items: center; gap: .3rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: .95rem; font-weight: 500;
  color: var(--ink-soft); background: none; border: 0;
  padding: .5rem .7rem; border-radius: 4px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.nav-top:hover { background: var(--frost); color: var(--ink); }
.nav-top[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-caret { width: 9px; height: 6px; transition: transform .22s ease; opacity: .65; }
.nav-group:hover .nav-caret,
.nav-top[aria-expanded="true"] .nav-caret { transform: rotate(180deg); opacity: 1; }

.nav-menu {
  position: absolute; top: calc(100% + .35rem); left: 0; z-index: 60;
  min-width: 244px; margin: 0; padding: .4rem;
  list-style: none; background: var(--white);
  border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 14px 40px rgba(12, 26, 46, .16);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s cubic-bezier(.22,.68,.32,1), visibility .2s;
}
.nav-menu::before {
  content: ""; position: absolute; top: -.35rem; left: 0; right: 0; height: .35rem;
}
.nav-group:hover .nav-menu,
.nav-group:focus-within .nav-menu,
.nav-menu.is-open {
  opacity: 1; visibility: visible; transform: none;
}
.nav-menu li { margin: 0; }
.nav-menu a {
  display: block; padding: .55rem .7rem; border-radius: 4px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: .9rem; color: var(--ink-soft); text-decoration: none;
  position: relative;
}
.nav-menu a::after { display: none; }
.nav-menu a:hover, .nav-menu a:focus-visible {
  background: var(--frost); color: var(--ink);
  transform: translateX(3px);
}
.nav-menu a { transition: background .16s ease, color .16s ease, transform .16s ease; }

/* Colour the submenu edge with the spectrum, one band per menu. */
.nav-group:nth-of-type(1) .nav-menu { border-top: 2px solid var(--b-violet); }
.nav-group:nth-of-type(2) .nav-menu { border-top: 2px solid var(--b-cyan); }
.nav-group:nth-of-type(3) .nav-menu { border-top: 2px solid var(--b-lime); }

/* A nine-item submenu is long; give it two columns on a wide screen. */
#menu-whatwedo, #menu-m1 { min-width: 430px; columns: 2; column-gap: .4rem; }
#menu-whatwedo li, #menu-m1 li { break-inside: avoid; }
@media (max-width: 880px) { #menu-whatwedo, #menu-m1 { min-width: 0; columns: 1; } }

@media (max-width: 880px) {
  .nav-group { width: 100%; }
  .nav-top { width: 100%; justify-content: space-between; padding: .8rem .5rem; }
  .nav-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-left: 2px solid var(--line);
    border-radius: 0; margin: 0 0 .4rem .5rem; padding: 0 0 0 .5rem;
    display: none;
  }
  .nav-menu.is-open { display: block; }
  .nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu { display: none; }
  .nav-group:hover .nav-menu.is-open, .nav-group:focus-within .nav-menu.is-open { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-menu { transition: none; }
  .nav-menu a:hover { transform: none; }
  .nav-caret { transition: none; }
}

/* ==========================================================================
   18. More visible motion
   Larger, more obviously animated effects than the ambient layer above —
   still nothing that moves while being read.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {

  /* Cover artwork drifts and brightens as a card is approached. */
  .lib-card__media img { transition: transform 1.1s cubic-bezier(.22,.68,.32,1), filter .5s ease; }
  .lib-card:hover .lib-card__media img { transform: scale(1.06) rotate(-.4deg); filter: brightness(1.12); }

  /* Cards tilt very slightly toward the cursor side. */
  .lib-card, .res-card, .bh-card, a.card {
    transition: transform .3s cubic-bezier(.22,.68,.32,1), box-shadow .3s ease, border-color .3s ease;
  }
  .lib-card:hover, .bh-card:hover { transform: translateY(-6px) scale(1.012); }
  a.card:hover { transform: translateY(-4px); }

  /* Section headings sweep their underline in when revealed. */
  .lib-series__head { position: relative; overflow: hidden; }
  .lib-series__head::after {
    content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
    background: var(--band, var(--accent)); transform: scaleX(0); transform-origin: left;
    transition: transform .9s cubic-bezier(.22,.68,.32,1);
  }
  [data-reveal].is-in .lib-series__head::after,
  .lib-series.is-in .lib-series__head::after { transform: scaleX(1); }

  /* Big statistics rise and settle. */
  .lib-stat dt { animation: stat-rise .9s cubic-bezier(.22,.68,.32,1) both; }
  .lib-stat:nth-child(2) dt { animation-delay: .1s; }
  .lib-stat:nth-child(3) dt { animation-delay: .2s; }
  .lib-stat:nth-child(4) dt { animation-delay: .3s; }
  @keyframes stat-rise {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to   { opacity: 1; transform: none; }
  }

  /* Buttons get a travelling sheen on hover. */
  .btn { position: relative; overflow: hidden; }
  .btn::after {
    content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
    transform: skewX(-18deg); transition: left .55s cubic-bezier(.22,.68,.32,1);
  }
  .btn:hover::after { left: 120%; }

  /* Ticks draw a short line as they arrive. */
  .ticks li { position: relative; }
  [data-reveal].is-in .ticks li::before { animation: tick-pop .5s cubic-bezier(.22,.68,.32,1) both; }
  @keyframes tick-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

  /* The spectrum strip sweeps once on load. */
  .spectrum { position: relative; overflow: hidden; }
  .spectrum::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
    transform: translateX(-100%);
    animation: strip-sweep 2.6s cubic-bezier(.22,.68,.32,1) .4s;
  }
  @keyframes strip-sweep { to { transform: translateX(100%); } }

  /* Figures lift out of the page a little on hover. */
  .figure { transition: transform .45s cubic-bezier(.22,.68,.32,1), box-shadow .45s ease; }
  .figure:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(12,26,46,.16); }

  /* Footer columns stagger in. */
  .footer-grid > * { animation: rise-in .7s cubic-bezier(.22,.68,.32,1) both; }
  .footer-grid > *:nth-child(2) { animation-delay: .08s; }
  .footer-grid > *:nth-child(3) { animation-delay: .16s; }
  .footer-grid > *:nth-child(4) { animation-delay: .24s; }
  .footer-grid > *:nth-child(5) { animation-delay: .32s; }
}

/* ==========================================================================
   19. Pledge banner
   A dismissible bar in the page flow. Deliberately not an interstitial:
   Google demotes those on mobile, and a modal on load is a focus-management
   problem on a site that sells accessibility audits.
   ========================================================================== */
.pledge {
  background: linear-gradient(100deg, var(--ink) 0%, #17293F 55%, #2A1F3D 100%);
  color: #E6ECF5;
  border-bottom: 1px solid rgba(255,255,255,.12);
  position: relative;
  overflow: hidden;
}
.pledge__inner {
  display: flex; align-items: center; gap: 1rem;
  padding-block: .85rem; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.pledge__text {
  margin: 0; flex: 1 1 22rem; min-width: 0;
  font-size: .95rem; line-height: 1.5; color: #C6D2E2;
}
.pledge__text b { color: #E9B872; font-family: "Bricolage Grotesque", sans-serif; }
.pledge__cta {
  flex: none;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: .88rem; font-weight: 600;
  background: #E9B872; color: #0C1A2E;
  padding: .5rem 1rem; border-radius: 999px; text-decoration: none;
  transition: background .18s ease, transform .18s ease;
}
.pledge__cta:hover { background: #fff; transform: translateY(-1px); text-decoration: none; }
.pledge__x {
  flex: none; background: none; border: 0; cursor: pointer;
  color: #A9BBD2; font-size: 1.35rem; line-height: 1;
  padding: .2rem .45rem; border-radius: 4px;
}
.pledge__x:hover { background: rgba(255,255,255,.14); color: #fff; }
.pledge[hidden] { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .pledge::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
    background: radial-gradient(40% 120% at 15% 50%, rgba(233,184,114,.16), transparent 70%);
    animation: pledge-drift 22s ease-in-out infinite alternate;
  }
  @keyframes pledge-drift {
    from { transform: translateX(-4%); }
    to   { transform: translateX(6%); }
  }
}
@media (max-width: 600px) { .pledge__cta { width: 100%; text-align: center; } }
