/* Wavelengths article reading experience - /articles/{slug} only.
   Hand-authored, no build step (there is no Tailwind binary on this host).
   Same loading pattern as public/css/support-centre.css.

   Colour rule enforced throughout: --pa is a 3:1-ish accent and is used for
   bars, rules and borders only, never for text. Text is always
   --brand-text / --brand-text-muted, both of which are AA in light and dark. */

.wl-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wl-focusable:focus-visible,
.wl-toc__link:focus-visible,
.wl-toc__toggle:focus-visible,
.wl-anchor:focus-visible,
.wl-faq__q:focus-visible,
.wl-readnext:focus-visible,
.wl-nextcard:focus-visible {
  outline: 2px solid var(--brand-text);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* ---------- Reading progress ---------- */

.wl-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  background: transparent;
}
.wl-progress__fill {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  /* transform-origin + scaleX is the whole point: animating width cannot be
     composited and caused the CLS 0.36 incident this file is written around. */
  transform-origin: left center;
  background: var(--pa, #06b6d4);
  will-change: transform;
  transition: transform 120ms linear;
}

/* ---------- Byline avatar ---------- */

/* Fixed teal, not --brand-accent: that token lightens to #2dd4bf in dark
   mode, which fails 4.5:1 against the white initials text below. A solid,
   non-theme-adaptive pair of stops keeps this AA in both themes at once. */
.wl-avatar {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e, #115e59);
}
.wl-avatar__initials {
  font-family: var(--font-heading, 'Space Grotesk', system-ui, sans-serif);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
}
.wl-avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Author "posting profile" pill ---------- */

/* A very small, lowkey affordance beside the byline name - not an accordion,
   not a modal. The pill is position: absolute (an overlay), so opening it
   never reflows the byline row or anything below it. */
.wl-author-name {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.0625rem;
}
.wl-author-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: none;
  cursor: pointer;
  color: var(--brand-text-muted);
  transition: color 160ms ease, background-color 160ms ease;
}
.wl-author-trigger:hover {
  color: var(--brand-text);
  background: var(--brand-surface-elevated);
}
.wl-author-trigger:focus-visible {
  outline: 2px solid var(--brand-text);
  outline-offset: 2px;
}
.wl-author-trigger__chevron {
  width: 0.625rem;
  height: 0.625rem;
  transition: transform 160ms ease;
}
.wl-author-trigger[aria-expanded='true'] .wl-author-trigger__chevron {
  transform: rotate(180deg);
}
/* Same touch-target reasoning as .wl-anchor above: a 22px icon button is fine
   for a mouse, but under the 44px minimum on a touchscreen. */
@media (pointer: coarse) {
  .wl-author-trigger {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* Anchored beside the trigger and vertically centred via the standalone
   `translate` property (not `transform`), so the enter/leave animation below
   can own `scale`/`opacity` independently without the two fighting over a
   single `transform` value. */
.wl-author-pill {
  position: absolute;
  top: 50%;
  left: calc(100% + 0.5rem);
  translate: 0 -50%;
  transform-origin: left center;
  scale: 1 1;
  opacity: 1;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 14rem;
  max-width: min(20rem, calc(100vw - 2.5rem));
  padding: 0.875rem 1rem;
  border: 1px solid var(--brand-border);
  border-radius: 1.25rem;
  background: var(--brand-surface-elevated);
  box-shadow: 0 12px 32px -10px rgba(15, 23, 42, 0.28);
}
/* Horizontal swipe-out: scaleX only, growing from the trigger's edge, rather
   than a height/width layout animation (see notes/PERFORMANCE-STANDARD.md). */
.wl-author-pill--enter-start,
.wl-author-pill--leave-end {
  opacity: 0;
  scale: 0.4 1;
}
.wl-author-pill--enter-end,
.wl-author-pill--leave-start {
  opacity: 1;
  scale: 1 1;
}
.wl-author-pill--enter,
.wl-author-pill--leave {
  transition: opacity 180ms ease, scale 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.wl-author-pill__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem 1.125rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.wl-author-pill__stat {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.wl-author-pill__link {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  border-radius: 0.375rem;
  text-decoration: none;
}
.wl-author-pill__link:hover .wl-author-pill__value,
.wl-author-pill__link:hover .wl-author-pill__label {
  color: var(--pa, #06b6d4);
}
.wl-author-pill__link:focus-visible {
  outline: 2px solid var(--brand-text);
  outline-offset: 3px;
}
.wl-author-pill__value {
  font-family: var(--font-heading, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--brand-text);
}
.wl-author-pill__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--brand-text-muted);
}
.wl-author-pill__linkedin {
  padding-top: 0.5rem;
  border-top: 1px solid var(--brand-border);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-text-muted);
  text-decoration: none;
}
.wl-author-pill__linkedin:hover {
  color: var(--brand-text);
  text-decoration: underline;
}

/* Narrow viewports: the side placement above can run out of room to the
   right and either overflow (clipped by .articles-page-root's overflow-x:
   hidden, so half the pill would be invisible) or crowd whatever sits beside
   it. Below-left instead, anchored to the name's own left edge, always stays
   fully on screen and never widens the page. */
@media (max-width: 640px) {
  .wl-author-pill {
    left: 0;
    top: 100%;
    translate: 0 0;
    margin-top: 0.5rem;
    transform-origin: left top;
  }
}

/* ---------- Layout shell ---------- */

/* DOM order is rail-then-main so the contents list is reachable before the
   body copy for keyboard and screen-reader users. On desktop the grid moves
   the rail visually to the right of the prose without changing that order. */
.wl-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 48rem;
  margin: 0 auto;
}
.wl-main {
  min-width: 0;
}

@media (min-width: 1180px) {
  .wl-shell {
    grid-template-columns: minmax(0, 1fr) 15rem;
    column-gap: 3rem;
    max-width: 68rem;
  }
  .wl-main {
    grid-column: 1;
    grid-row: 1;
  }
  .wl-rail {
    grid-column: 2;
    grid-row: 1;
  }
  .wl-rail__inner {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
  }
}

/* ---------- Table of contents ---------- */

.wl-toc {
  margin-bottom: 1.5rem;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  background: var(--brand-surface-elevated);
}
.wl-toc__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-text);
}
.wl-toc__chevron {
  width: 0.75rem;
  height: 0.75rem;
  flex: none;
  transition: transform 160ms ease;
}
.wl-toc__toggle[aria-expanded='true'] .wl-toc__chevron {
  transform: rotate(180deg);
}
.wl-toc__panel {
  display: block;
  padding: 0 1rem 0.875rem;
}
@media (max-width: 1179px) {
  .wl-toc.wl-toc--collapsible .wl-toc__panel:not(.is-open) {
    display: none;
  }
}
/* Mobile uses the toggle button's own label, so the rail heading is desktop
   only. Declared before the media query that turns it on: same specificity,
   so source order decides. */
.wl-toc__heading {
  display: none;
}
.wl-toc__panel.is-open {
  display: block;
}
.wl-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--brand-border);
}
.wl-toc__item--3 {
  padding-left: 0.875rem;
}
.wl-toc__link {
  display: block;
  padding: 0.3125rem 0.75rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--brand-text-muted);
  text-decoration: none;
}
/* The mobile TOC is a tap-only accordion of links (no hover on touch), so
   its rows need a real touch target; a mouse-driven desktop rail keeps the
   tighter list spacing it already had. */
@media (pointer: coarse) {
  .wl-toc__link {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-top: 0;
    padding-bottom: 0;
  }
}
.wl-toc__link:hover {
  color: var(--brand-text);
}
.wl-toc__link[aria-current='true'] {
  color: var(--brand-text);
  font-weight: 600;
  border-left-color: var(--pa, #06b6d4);
}

@media (min-width: 1180px) {
  .wl-toc {
    margin-bottom: 0;
    border: 0;
    background: none;
    border-radius: 0;
  }
  .wl-toc__toggle {
    display: none;
  }
  /* Desktop rail is always open: the disclosure is a mobile affordance only,
     and the button that controls it is display:none (so out of the a11y tree)
     at this width. */
  .wl-toc__panel {
    display: block;
    padding: 0;
  }
  .wl-toc__heading {
    display: block;
    margin-bottom: 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-text-muted);
  }
}

/* ---------- Heading anchors ---------- */

.wl-h {
  position: relative;
  scroll-margin-top: 6rem;
}
.wl-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: 0.375rem;
  vertical-align: middle;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  color: var(--brand-text-muted);
  opacity: 0;
  transition: opacity 140ms ease;
}
.wl-h:hover .wl-anchor,
.wl-anchor:focus-visible,
.wl-anchor.is-copied {
  opacity: 1;
}
/* Audit finding (768px and below, coarse pointers generally): the anchor's
   :hover reveal never fires on touch, so the 24x24px button was both
   invisible and under the 44x44 minimum. Widened to a real touch target and
   made permanently visible; left untouched on a mouse, where the hover
   affordance still works as designed. */
@media (pointer: coarse) {
  .wl-anchor {
    width: 2.75rem;
    height: 2.75rem;
    opacity: 1;
  }
}
.wl-anchor__flash {
  margin-left: 0.5rem;
  font-family: var(--font-body, system-ui, sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand-text-muted);
  vertical-align: middle;
}

/* ---------- Cut to the chase ---------- */

.wl-tldr {
  margin: 0 0 2rem;
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--brand-border);
  border-left: 3px solid var(--pa, #06b6d4);
  border-radius: 0.875rem;
  background: var(--brand-surface-elevated);
  scroll-margin-top: 6rem;
}
.wl-tldr__label {
  display: block;
  margin-bottom: 0.4375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-text-muted);
}
.wl-tldr__text {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--brand-text);
}

/* ---------- FAQ ---------- */

.wl-faq {
  margin: 2.5rem 0;
  scroll-margin-top: 6rem;
}
.wl-faq__title {
  margin: 0 0 1rem;
  font-family: var(--font-heading, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--brand-text);
}
.wl-faq__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--brand-border);
}
.wl-faq__item {
  border-bottom: 1px solid var(--brand-border);
  margin: 0;
}
.wl-faq__qh {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}
.wl-faq__q {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.9375rem 0.25rem;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--brand-text);
}
.wl-faq__sign {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  margin-top: 0.3125rem;
  transition: transform 160ms ease;
}
.wl-faq__q[aria-expanded='true'] .wl-faq__sign {
  transform: rotate(180deg);
}
.wl-faq__a {
  display: block;
  margin: 0;
  padding: 0 0.25rem 1.0625rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--brand-text-muted);
}
.wl-faq--accordion .wl-faq__a {
  display: none;
}
.wl-faq--accordion .wl-faq__a.is-open {
  display: block;
}

/* ---------- Read next / next post ---------- */

.wl-readnext {
  display: block;
  margin: 2.5rem 0;
  padding: 1rem 1.125rem;
  border: 1px solid var(--brand-border);
  border-radius: 0.875rem;
  background: var(--brand-surface-elevated);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}
.wl-readnext:hover {
  transform: translateY(-1px);
  border-color: var(--pa, #06b6d4);
}
.wl-readnext__label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-text-muted);
}
.wl-readnext__title {
  display: block;
  font-family: var(--font-heading, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--brand-text);
}

.wl-nextcard {
  display: block;
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--brand-border);
  border-radius: 1.25rem;
  background: var(--brand-surface-elevated);
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}
.wl-nextcard:hover {
  transform: translateY(-2px);
  border-color: var(--pa, #06b6d4);
}
.wl-nextcard__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-text-muted);
}
.wl-nextcard__title {
  display: block;
  font-family: var(--font-heading, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--brand-text);
}
.wl-nextcard__summary {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--brand-text-muted);
}
.wl-nextcard__meta {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: var(--brand-text-muted);
}

/* ---------- Images ---------- */

/* Plain inline image: never allowed to break layout at any viewport, however
   large or oddly shaped the source file is. width/height on the <img> itself
   (see _block.blade.php) reserve the box before it loads; these two rules are
   the belt-and-braces that stop it ever overflowing regardless. */
.wl-img img {
  max-width: 100%;
  height: auto;
}

/* Highlight: one purely presentational, larger/featured treatment for a
   single image an author calls out with the "highlight" modifier. Kept
   inside the normal reading column (no viewport-breakout margin tricks,
   which risk overflow in a layout this file does not own) - the distinction
   is a stronger border, a shadow and extra breathing room, nothing more. It
   carries no different safety or accessibility behaviour than a plain
   inline image. */
.wl-img--highlight {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}
.wl-img--highlight img {
  border-width: 2px;
  border-color: var(--pa, #06b6d4);
  box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.25);
}
.wl-img--highlight figcaption {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
}

/* ---------- Video embed ---------- */

/* Fixed 16:9 box via the padding-top trick, so the iframe never distorts the
   page and never needs its own explicit pixel size. */
.wl-video {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--brand-surface-elevated);
}
.wl-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Reading controls (reader mode + font size) ---------- */

/* A small, low-key toolbar beside the byline - never a banner. Buttons only,
   real focus rings, no icon-only control with no accessible name. */
.wl-reading-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1.125rem;
}
.wl-reader-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  background: var(--brand-surface-elevated);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: var(--brand-text-muted);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.wl-reader-toggle:hover {
  color: var(--brand-text);
  border-color: var(--pa, #06b6d4);
}
.wl-reader-toggle.is-active {
  color: var(--brand-text);
  border-color: var(--pa, #06b6d4);
  background: color-mix(in srgb, var(--pa, #06b6d4) 10%, var(--brand-surface-elevated));
}
.wl-reader-toggle__feather {
  width: 0.9375rem;
  height: 0.9375rem;
  flex: none;
  opacity: 0.75;
}
.wl-font-controls {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  overflow: hidden;
}
.wl-font-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.375rem 0.625rem;
  border: 0;
  background: var(--brand-surface-elevated);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  color: var(--brand-text-muted);
  transition: background-color 160ms ease, color 160ms ease;
}
.wl-font-btn:first-child {
  border-right: 1px solid var(--brand-border);
}
.wl-font-btn:hover:not(:disabled) {
  color: var(--brand-text);
  background: color-mix(in srgb, var(--pa, #06b6d4) 8%, var(--brand-surface-elevated));
}
.wl-font-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.wl-reader-toggle:focus-visible,
.wl-font-btn:focus-visible {
  outline: 2px solid var(--brand-text);
  outline-offset: 2px;
}

/* Audit finding: the reader-mode toggle (~30px tall) and the A-/A+ font
   buttons (~30px tall, 36px wide) both sit well under the 44px touch
   minimum, and the two font buttons are flush against one another with
   nothing but a 1px border between them - an easy mis-tap. Grown on touch
   only; the toolbar already wraps (flex-wrap on .wl-reading-controls), so
   the extra height cannot cause overflow at any width. */
@media (pointer: coarse) {
  .wl-reader-toggle {
    min-height: 2.75rem;
    padding-top: 0;
    padding-bottom: 0;
  }
  .wl-font-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Font size: the article's own body copy is scaled via a CSS custom property
   set inline on .wl-main (see show.blade.php's fontScale()), never via
   transform/zoom - real font-size change is what makes the text genuinely
   reflow and stay crisp, rather than a blurred visual scale. Only the
   elements that actually carry reading text are targeted; headings keep
   their own independent sizing, unchanged, matching the separation the rest
   of this file already draws between heading and body typography. Bounds
   are enforced in Alpine (fontStepMin/fontStepMax), so --wl-font-scale never
   leaves a sane 0.8-1.3 range and the 68ch measure on .tdx-article-body
   (set in its own font-size, untouched here) keeps the column width sane. */
.wl-main {
  --wl-font-scale: 1;
}
.tdx-article-body p,
.tdx-article-body li,
.tdx-article-body blockquote {
  font-size: calc(1rem * var(--wl-font-scale, 1));
  line-height: 1.75;
  transition: font-size 160ms ease;
}
.tdx-article-body pre,
.tdx-article-body pre code {
  font-size: calc(0.875rem * var(--wl-font-scale, 1));
  line-height: 1.7;
  transition: font-size 160ms ease;
}

/* ---------- Reader mode ---------- */

/* Distraction-free reading: TOC rail and progress bar quietened, generous
   whitespace, a calm paper-like background. Two classes beat the single-class
   Tailwind utilities already on these elements (bg-[var(--brand-bg)] etc.),
   so no !important is needed regardless of stylesheet order. Never pure
   black in the dark variant - a warm, very dark tone instead. */
.wl-reader.articles-page-root {
  --wl-paper-bg: #f7f3ea;
  background-color: var(--wl-paper-bg);
}
.dark .wl-reader.articles-page-root {
  --wl-paper-bg: #1c1812;
}
.wl-reader .wl-progress {
  opacity: 0.35;
}
.wl-reader .wl-rail {
  display: none;
}
.wl-reader .wl-shell {
  grid-template-columns: minmax(0, 1fr);
  max-width: 42rem;
}
@media (min-width: 1180px) {
  .wl-reader .wl-shell {
    max-width: 42rem;
  }
}
.wl-reader .wl-main {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.wl-reader .tdx-article-body p,
.wl-reader .tdx-article-body li,
.wl-reader .tdx-article-body blockquote {
  line-height: 1.85;
}
.wl-reader .wl-readnext,
.wl-reader .wl-toc {
  opacity: 0.9;
}

/* Time-of-day tint: reuses the site-wide --tide-wash-image custom property
   (public/css/marketing.css, set on <html data-tide>) rather than inventing
   new dawn/dusk/night colours. Defaults to none outside the tide theme, so
   this is entirely inert unless the visitor has already chosen "tide" as
   their site theme. A pseudo-element keeps it out of the accessibility tree
   and behind the text, so it can never reduce reading contrast. */
.wl-reader .wl-shell {
  position: relative;
}
.wl-reader .wl-shell::before {
  content: '';
  position: absolute;
  inset: -2rem -1rem;
  z-index: -1;
  pointer-events: none;
  background-image: var(--tide-wash-image, none);
  opacity: 0.7;
}

/* A very small scatter of stars, visible only in reader mode after dusk -
   restrained on purpose (a reader's dream, not a night sky). Colour is
   --brand-text-muted at low alpha via color-mix, so no new palette entries
   are introduced for this either. */
html[data-tide='dusk'] .wl-reader .wl-shell::after,
html[data-tide='night'] .wl-reader .wl-shell::after {
  content: '';
  position: absolute;
  top: -1.75rem;
  right: 0.25rem;
  width: 7rem;
  height: 5rem;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--brand-text-muted) 55%, transparent) 0 1.4px, transparent 1.6px),
    radial-gradient(circle at 68% 45%, color-mix(in srgb, var(--brand-text-muted) 45%, transparent) 0 1px, transparent 1.2px),
    radial-gradient(circle at 40% 60%, color-mix(in srgb, var(--brand-text-muted) 40%, transparent) 0 1px, transparent 1.2px),
    radial-gradient(circle at 22% 15%, color-mix(in srgb, var(--brand-text-muted) 40%, transparent) 0 1px, transparent 1.2px);
}

/* ---------- Author signature sign-off ---------- */

/* Sits directly under the prose, so it shares the article's 68ch measure
   (.tdx-article-body in marketing-app.css is centred at that width) rather
   than starting further left than the paragraph above it. */
.wl-signature {
  max-width: 68ch;
  margin: 2.5rem auto 0;
}

/* Fixed box, not intrinsic sizing. The three candidate files (full signature,
   two-character initials, three-character initials) do not share an aspect
   ratio, and the browser may swap between them via the onerror chain after
   first paint - reserving one box and letting object-fit letterbox inside it
   means a swap cannot move a single pixel of the page. Left-aligned so it
   reads as a signature under the text, not a centred graphic. */
.wl-signature__img {
  display: block;
  width: 160px;
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

/* WHY invert: the CDN holds one asset per signature, black ink on
   transparency, and there is no light-ink variant to swap to. Unmodified it
   is invisible against a dark background, so it is inverted to white ink and
   knocked back slightly, which reads as ink rather than glare.

   The selector is `.dark`, matching every other dark rule in this file
   (e.g. .dark .wl-reader.articles-page-root above). That single class is the
   site's only dark signal: the inline bootstrap in layouts/marketing.blade.php
   resolves the manual toggle, the "system" setting's prefers-color-scheme
   query, and the dusk/night tide themes all down to it. A bare
   @media (prefers-color-scheme: dark) here would be wrong, not merely
   redundant - it would invert the signature for someone whose OS is dark but
   who has explicitly chosen the light theme. */
.dark .wl-signature__img {
  filter: invert(1);
  opacity: 0.82;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .wl-progress__fill,
  .wl-toc__chevron,
  .wl-faq__sign,
  .wl-anchor,
  .wl-readnext,
  .wl-nextcard,
  .wl-reader-toggle,
  .wl-font-btn,
  .wl-author-trigger__chevron,
  .wl-author-pill--enter,
  .wl-author-pill--leave,
  .tdx-article-body p,
  .tdx-article-body li,
  .tdx-article-body blockquote,
  .tdx-article-body pre,
  .tdx-article-body pre code {
    transition: none !important;
  }
  .wl-readnext:hover,
  .wl-nextcard:hover {
    transform: none;
  }
  /* The anchor affordance stops being a fade and becomes permanently
     available, rather than appearing with no transition on hover only. */
  .wl-anchor {
    opacity: 1;
  }
}
