/* aimlink.ai News page (news/index.html). Load after site.css, nav.css and assets/news/news.css (the category tags).
   Script: assets/news-page.js. Stories: content/news.js.

   News is momentum. Top to bottom, on the frame of the app pages (dark hero, light content, dark footer):
   1. Hero (data-rhythm="hero"): the statement on a macro photograph of a paper target with a scrim for the words (our
      own generated still, and a 10 s loop of its light unless the visitor prefers reduced motion or Save-Data), the
      three facts we can state today as stat tiles, and the featured story, the latest release, which hangs over the
      hero's hard edge as the phone does on the GO page: it rides up on load and one lime ring goes out, once.
   2. Archive (data-rhythm="proof"): category chips, then every story grouped by year. No boxes: picture, tag and
      date, a Teko title, one line. Rows of two and three, planned per year so no row ends ragged. The search and the
      year links wait until there are more than 30 stories (SEARCH_MIN in news-page.js).
   3. Story: a large sheet (a <dialog>). Where the browser can, the card's picture grows into the sheet's cover and
      shrinks back into the card on close (View Transitions); everywhere else the sheet fades up.
   Static by default: without JS the page is the hero (the photograph as a still), the featured story and a plain list
   of every story (written into the HTML by news/build_news.py). Reduced motion keeps colour and opacity, drops the
   travel. Type and space come from the tokens: --type-display-xl (H1), --type-display-l (H2), --type-display-m (lead,
   year numerals), --type-title (card titles); --gap-* inside a group, --space-* between. */

@layer sections {
  /* The sheet locks the page behind it; the gutter stays so nothing jumps sideways when it does */
  html { scrollbar-gutter: stable; }
  html:has(.np-modal[open]) { overflow: hidden; }

  /* ───────────────────────── The top: hero, momentum and featured story ───────────────────────── */
  .np-top {
    /* the cover's width and height, and how much of that height hangs up into the hero */
    --np-cw: calc(min(100vw, var(--container) + 2 * var(--gutter)) - 2 * var(--gutter));
    --np-ch: calc(var(--np-cw) * 2 / 3);
    --np-over: calc(var(--np-ch) * 0.5);
    position: relative; isolation: isolate;
  }
  @media (min-width: 900px) {
    .np-top { --np-cw: calc((min(100vw, var(--container) + 2 * var(--gutter)) - 2 * var(--gutter)) * 0.58); --np-over: calc(var(--np-ch) * 0.56); }
  }

  /* data-rhythm="hero" gives the top (hero air plus the nav). The bottom leaves room for the hanging cover on phones;
     on desktop the cover shares the zone beside the lede and the tiles. */
  .np-hero { position: relative; isolation: isolate; overflow: clip; background: var(--color-night); color: var(--text); padding-bottom: calc(var(--np-over) + var(--space-5)); }
  @media (min-width: 900px) { .np-hero { padding-bottom: var(--space-7); } }
  .np-hero-copy { display: grid; justify-items: start; align-content: start; }
  .np-hero .hl { display: block; }
  .np-hero-sub { display: grid; justify-items: start; align-content: start; width: 100%; margin-top: var(--gap-head); container-type: inline-size; }
  .np-hero .lede { color: var(--text); opacity: 0.92; max-width: 34ch; }
  .np-hero .w { display: inline-block; animation: rise var(--duration-reveal) var(--ease-out) both; animation-delay: calc(120ms + var(--i) * var(--motion-stagger)); }
  .np-hero .lede { animation: rise var(--duration-reveal) var(--ease-out) 420ms both; }
  .np-hero .np-momentum { animation: rise var(--duration-reveal) var(--ease-out) 520ms both; }
  @media (min-width: 900px) {
    /* the left column: the lede and the tiles, beside the cover that hangs up into the hero */
    .np-hero-sub { width: calc(100% - var(--np-cw) - var(--grid-gap)); }
  }

  /* The photograph and its scrim. The still is the poster (no JS, reduced motion, Save-Data); the loop fades in over it. */
  .np-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--color-night); pointer-events: none; }
  .np-bg picture, .np-bg-img, .np-bg-video { position: absolute; inset: 0; width: 100%; height: 100%; }
  .np-bg-img, .np-bg-video { object-fit: cover; object-position: 70% 38%; }
  .np-bg-video { opacity: 0; transition: opacity 700ms var(--ease-out); }
  .np-bg-video.is-playing { opacity: 1; }
  /* the scrim: night under the words, clear over the target (measured against the lightest pixel behind any text) */
  .np-bg::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgb(12 20 28 / 0.7) 0%, rgb(12 20 28 / 0.64) 56%, rgb(12 20 28 / 0.34) 100%);
  }
  @media (min-width: 768px) {
    .np-bg-img, .np-bg-video { object-position: 62% 40%; }
  }
  @media (min-width: 900px) {
    .np-bg::after {
      background:
        linear-gradient(180deg, rgb(12 20 28 / 0.55) 0%, transparent 22%),
        linear-gradient(90deg, rgb(12 20 28 / 0.9) 0%, rgb(12 20 28 / 0.84) 32%, rgb(12 20 28 / 0.66) 50%, rgb(12 20 28 / 0.18) 70%, transparent 88%);
    }
  }
  /* the pause button: top right under the nav, one 44 px button (the loop is longer than 5 s) */
  .np-pause { bottom: auto; right: var(--gutter); top: calc(var(--nav-space) + var(--space-3)); }
  .np-pause[hidden] { display: none; }

  /* the momentum: three facts in Figma's stat tiles. A row each on phones, three across where the column is wide enough. */
  .np-momentum { display: grid; gap: var(--space-2); width: 100%; margin-top: var(--gap-action); }
  .np-momentum .stat-tile { grid-template-columns: 8.5rem minmax(0, 1fr); justify-items: start; text-align: left; align-items: center; column-gap: var(--space-3); padding: var(--space-2) var(--space-4); }
  .np-momentum .num { white-space: nowrap; }
  @container (min-width: 30rem) {
    .np-momentum { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); }
    .np-momentum .stat-tile { grid-template-columns: none; justify-items: center; text-align: center; padding: var(--space-3) var(--space-2); }
  }

  /* the shot: one lime ring leaves where the story lands, clipped by the hero so it never reaches the light page */
  .np-shot {
    position: absolute; z-index: 0; pointer-events: none; aspect-ratio: 1; border-radius: 50%;
    width: calc(var(--np-cw) * 0.8); left: 50%; top: calc(100% - var(--np-ch) * 0.06);
    translate: -50% -50%; border: 1.5px solid var(--color-lime); opacity: 0; transform: scale(0.55);
    animation: np-shot 760ms var(--ease-out) 1100ms both;
  }
  @keyframes np-shot { from { opacity: 0.85; transform: scale(0.55); } to { opacity: 0; transform: scale(2.3); } }
  @media (min-width: 900px) { .np-shot { left: calc(100% - var(--gutter) - var(--np-cw) / 2); } }

  /* the lead's top is the cover, hanging up into the hero: data-rhythm="tight" keeps its bottom, the top is zero */
  .np-lead { position: relative; background: var(--bg); padding-top: 0; }
  .np-lead-link { display: grid; gap: var(--gap-group); color: inherit; }
  .np-lead-media {
    width: 100%; aspect-ratio: 3 / 2; margin-top: calc(-1 * var(--np-over));
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), var(--shadow-lg);
    /* the ride up, as the phone on the GO page: from below and leaning back, to rest */
    animation: np-ride 700ms var(--ease-out) 180ms both;
  }
  @keyframes np-ride { from { opacity: 0; transform: perspective(1400px) translateY(14%) rotateX(12deg) scale(0.96); } }
  .np-lead-copy { display: grid; justify-items: start; }
  .np-lead-copy .np-meta + .np-lead-title { margin-top: var(--gap-kicker); }
  .np-lead-title { max-width: 14ch; }
  .np-lead-title + .lede { margin-top: var(--gap-head); }
  .np-lead .lede { max-width: 38ch; }
  .np-lead .lede + .np-lead-more { margin-top: var(--gap-action); }
  .np-lead-more { display: inline-flex; align-items: center; gap: var(--space-3); font-weight: 700; color: var(--text); }
  @media (min-width: 900px) {
    .np-lead-link { grid-template-columns: minmax(0, 1fr) var(--np-cw); column-gap: var(--grid-gap); align-items: start; }
    .np-lead-media { grid-column: 2; grid-row: 1; }
    .np-lead-copy { grid-column: 1; grid-row: 1; padding-top: var(--space-7); }
  }

  /* ───────────────────────── Shared by the featured story, the cards and the sheet ───────────────────────── */
  .np-media img { transition: transform 300ms var(--ease-out); }
  .np-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--type-small-size); line-height: 1.3; color: var(--text-subtle); }
  /* under a picture the tags need no glass */
  .np-meta .news-tag:not([data-cat]), .np-meta .news-tag[data-cat="company-press"] { background: var(--color-ink); color: var(--color-snow); -webkit-backdrop-filter: none; backdrop-filter: none; }
  /* the featured story: the release's version, and the label that says it is not real yet */
  .np-ver { color: var(--text-muted); font-weight: 700; }
  .np-ph {
    display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--space-3); border-radius: var(--radius-pill);
    box-shadow: inset 0 0 0 1.5px var(--text-subtle); color: var(--text-muted);
    font: 700 var(--type-label-size)/1 var(--font-text); letter-spacing: var(--type-label-tracking); text-transform: uppercase;
  }
  /* a title's underline: colour only, so it follows the title over two or three lines */
  .np-u { text-decoration: underline; text-decoration-thickness: var(--line-underline); text-underline-offset: 0.1em; text-decoration-color: transparent; transition: text-decoration-color var(--duration-hover) var(--ease-hover); }
  @media (hover: hover) and (pointer: fine) {
    .np-open:hover .np-media img { transform: scale(1.04); }
    .np-open:hover .np-u { text-decoration-color: currentColor; }
  }
  .np-open:focus-visible .np-u { text-decoration-color: currentColor; }
  .np-open:focus-visible { outline-offset: 6px; border-radius: var(--radius-xs); }
  .np-open .np-media { transition: transform var(--duration-press) var(--ease-out); }
  .np-open:active .np-media { transform: scale(0.985); }

  /* ───────────────────────── The archive ───────────────────────── */
  /* data-rhythm="proof" gives the padding; the head and the list are two groups, a group gap apart */
  .np-archive { background: var(--bg); }
  .np-archive-head { display: grid; justify-items: start; margin-bottom: var(--gap-group); }
  .np-archive-head .np-note { margin-top: var(--gap-head); }
  .np-archive-head .np-tools { margin-top: var(--gap-action); width: 100%; }
  /* The heading's letters float up with the scroll (ScrollFloat, assets/rb.js adds .rb-float). The lime block behind "on record." used
     to stand there whole and empty while its letters were still on their way; now it draws in from the left under them, on the same
     scroll (a compositor transform on a pseudo-element, timed to the letters of the second half). Without scroll timelines, reduced
     motion or JavaScript the block is simply there, as before. (2026-11 go-live) */
  @supports (animation-timeline: view()) {
    #np-archive-title.rb-float em { position: relative; isolation: isolate; background: none; }
    #np-archive-title.rb-float em::before {
      content: ""; position: absolute; inset: 0; z-index: -1; background: var(--emphasis-bg);
      transform-origin: 0 50%; animation: np-slab linear both; animation-timeline: view(block); animation-range: cover 16vh cover 36vh;
    }
    @keyframes np-slab { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  }
  .np-note { font-size: var(--type-small-size); line-height: var(--type-small-leading); color: var(--text-subtle); max-width: var(--measure-body); }

  .np-tools { display: grid; gap: var(--space-4); }
  .np-tools[hidden] { display: none; }
  /* category chips (the .chip component): a row that scrolls on phones, wraps from 900 px */
  .np-filter {
    display: flex; gap: var(--space-2); margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter);
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
  }
  .np-filter::-webkit-scrollbar { display: none; }
  .np-filter .chip { flex: none; scroll-snap-align: start; white-space: nowrap; }
  @media (min-width: 900px) {
    .np-filter { margin-inline: 0; padding-inline: 4px; margin-left: -4px; flex-wrap: wrap; overflow: visible; }
  }

  /* under the chips: how many stories (and, once the stories span two years, the year links and the search) */
  .np-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); color: var(--text-subtle); font-size: var(--type-small-size); }
  .np-status:has(.np-search) { justify-content: space-between; }
  .np-years { display: flex; align-items: center; gap: var(--space-1); min-height: 44px; }
  .np-years a { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0.15em 8px 0; border-radius: var(--radius-pill); font: 500 1.375rem/1 var(--font-numeric); font-variant-numeric: tabular-nums; color: var(--text-muted); transition: color var(--duration-hover) var(--ease-hover), background-color var(--duration-hover) var(--ease-hover); }
  @media (hover: hover) and (pointer: fine) { .np-years a:hover { color: var(--text); background: var(--bg-alt); } }
  .np-search { position: relative; display: flex; align-items: center; flex: 1 0 100%; }
  .np-search .ic { position: absolute; left: 10px; width: 34px; height: 34px; color: var(--text-subtle); pointer-events: none; }
  .np-search input {
    width: 100%; min-height: 48px; padding: 0 16px 0 48px; border: 0; border-radius: var(--radius-pill);
    background: var(--bg-alt); color: var(--text); box-shadow: inset 0 0 0 1px var(--border);
    transition: box-shadow var(--duration-hover) var(--ease-hover);
  }
  .np-search input::placeholder { color: var(--text-subtle); opacity: 1; }
  .np-search input:focus-visible { outline: var(--line-focus) solid var(--focus); outline-offset: 2px; box-shadow: inset 0 0 0 1px var(--focus); }
  .np-search input::-webkit-search-cancel-button { cursor: pointer; }
  @media (min-width: 900px) { .np-search { flex: 0 1 18rem; } }

  /* Before the script has drawn the archive: the plain list, or (with JS on its way) room for it */
  .np-static { display: grid; gap: var(--gap-item); }
  .np-static li { display: grid; gap: var(--space-1); padding-bottom: var(--gap-item); border-bottom: var(--line-hairline) solid var(--line); }
  .np-static p { color: var(--text-muted); max-width: var(--measure-body); }
  .np-static .np-meta { color: var(--text-subtle); }
  .np-static .title a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.2em; }
  .np-static .title a:hover, .np-static .title a:focus-visible { text-decoration-color: currentColor; }
  /* Without JavaScript every story is readable on the page (news/build_news.py writes them inside <noscript>) */
  .np-static-stories { display: grid; gap: var(--space-8); margin-top: var(--space-8); }
  .np-static-story { display: grid; gap: var(--space-4); scroll-margin-top: 6rem; padding-top: var(--space-6); border-top: var(--line-hairline) solid var(--line); }
  .np-static-story > .np-meta { color: var(--text-subtle); }
  .np-static-story .lede { max-width: 38ch; }
  .js .np-list:not(.is-rendered) { min-height: 48rem; }
  .js .np-list:not(.is-rendered) .np-static { visibility: hidden; }

  /* A year: its number stands beside its stories and stays in view while they pass (from 1100 px) */
  .np-year { display: grid; gap: var(--gap-item); scroll-margin-top: 6rem; }
  .np-year + .np-year { margin-top: var(--gap-group); padding-top: var(--gap-group); border-top: var(--line-hairline) solid var(--line); }
  .np-year-num { font: 500 var(--type-display-m-size)/0.9 var(--font-numeric); font-variant-numeric: tabular-nums; letter-spacing: 0; }
  @media (min-width: 1100px) {
    .np-year { grid-template-columns: minmax(0, 2fr) minmax(0, 10fr); column-gap: var(--grid-gap); }
    .np-year-head { position: sticky; top: 7rem; align-self: start; }
  }

  .np-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6) var(--grid-gap); }
  .np-card-link { display: grid; align-content: start; gap: var(--space-3); color: inherit; }
  .np-card .np-media { aspect-ratio: 3 / 2; }
  .np-card-title { text-wrap: balance; }
  .np-card-sum { color: var(--text-muted); font-size: var(--type-small-size); line-height: var(--type-small-leading); max-width: 46ch; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

  /* Phones: the first story of a year is whole, the rest are rows (picture left, words right) */
  @media (max-width: 599.98px) {
    .np-card:not(:first-child) .np-card-link { grid-template-columns: 7.25rem minmax(0, 1fr); column-gap: var(--space-4); align-items: start; }
    .np-card:not(:first-child) .np-media { grid-row: 1 / span 3; aspect-ratio: 1; }
    .np-card:not(:first-child) .np-card-sum { display: none; }
  }
  /* Tablets: two a row; an odd year opens with one story across both columns */
  @media (min-width: 600px) and (max-width: 1099.98px) {
    .np-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .np-card:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
    .np-card:first-child:nth-last-child(odd) .np-card-link { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: var(--space-5); align-items: center; }
    .np-card:first-child:nth-last-child(odd) .np-media { grid-row: 1 / span 3; }
  }
  /* Desktop: rows of two and three on six columns, set per story by the script (plan() in news-page.js) */
  @media (min-width: 1100px) {
    .np-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: var(--space-7); }
    .np-card { grid-column: span 2; }
    .np-card--w { grid-column: span 3; }
    .np-card--w .np-media { aspect-ratio: 16 / 10; }
    .np-card--solo { grid-column: 1 / -1; }
    .np-card--solo .np-card-link { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); column-gap: var(--space-6); align-items: center; }
    .np-card--solo .np-media { grid-row: 1 / span 3; aspect-ratio: 16 / 10; }
    .np-card--solo .np-card-sum { font-size: var(--type-body-size); line-height: var(--type-body-leading); }
  }

  /* Cards come in as they scroll into view (the site's reveal: opacity and a 16 px rise, 60 ms apart) */
  .np-armed .np-card:not(.is-in) { opacity: 0; transform: translateY(var(--motion-rise)); }
  .np-armed .np-card { transition: opacity var(--duration-reveal) var(--ease-out), transform var(--duration-reveal) var(--ease-out); transition-delay: var(--d, 0ms); }
  /* a new filter without view transitions: the stories fade in together */
  .np-list.is-swapped .np-year { animation: np-fade var(--duration-exit) var(--ease-out) both; }
  @keyframes np-fade { from { opacity: 0; } }

  .np-empty { display: grid; justify-items: start; gap: var(--gap-head); padding-block: var(--space-8); }
  .np-empty .h3 { max-width: 16ch; }

  /* ───────────────────────── The story sheet ───────────────────────── */
  .np-modal {
    position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0;
    padding: clamp(0.75rem, 2.5vw, 2rem); background: transparent; color: var(--text); overflow: hidden;
  }
  .np-modal[open] { display: grid; place-items: center; }
  .np-modal::backdrop { background: color-mix(in srgb, var(--color-night) 74%, transparent); opacity: 1; transition: opacity var(--duration-nav) var(--ease-out); }
  .np-sheet {
    position: relative; display: flex; width: min(100%, 64rem); max-height: 100%; overflow: hidden;
    border-radius: var(--radius-panel); background: var(--bg); box-shadow: 0 40px 90px -30px rgb(0 0 0 / 0.6);
    opacity: 1; transform: none;
    transition: opacity var(--duration-nav) var(--ease-out), transform var(--duration-morph) var(--ease-out);
  }
  /* the story scrolls inside the sheet, so the sheet's round corners also trim the scrollbar */
  .np-scroll { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--color-mist) transparent; }
  /* the sheet opens with the close button focused (autofocus); if the scroller itself ever has focus it shows the site ring, inside the edge */
  .np-scroll:focus-visible { outline: var(--line-focus) solid var(--focus); outline-offset: calc(-1 * var(--line-focus) - 2px); }
  /* in: fades up. out: opacity only, 200 ms (DESIGNDIRECTION 8.3) */
  @starting-style {
    .np-modal[open] .np-sheet { opacity: 0; transform: translateY(var(--motion-rise)) scale(0.98); }
    .np-modal[open]::backdrop { opacity: 0; }
  }
  .np-modal.is-closing .np-sheet, .np-modal.is-closing::backdrop { opacity: 0; transition: opacity var(--duration-exit) var(--ease-out); }
  /* while a view transition carries the picture, the sheet itself holds still */
  .np-modal.is-vt .np-sheet, .np-modal.is-vt::backdrop { transition: none; }

  .np-sheet-bar { position: sticky; top: 0; z-index: 2; height: 0; }
  .np-close { position: absolute; top: 14px; right: 14px; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.18); }
  /* how far down the story you are */
  .np-progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent-text); transform-origin: left; transform: scaleX(0); }
  @supports (animation-timeline: scroll()) {
    .np-progress { animation: np-progress linear both; animation-timeline: scroll(nearest block); }
  }
  @keyframes np-progress { to { transform: scaleX(1); } }

  .np-story-cover { aspect-ratio: 3 / 2; border-radius: var(--radius-panel) var(--radius-panel) 0 0; background: var(--color-night); }
  .np-story-col { display: grid; gap: var(--space-5); width: min(100%, var(--container-text) + 2 * var(--space-5)); margin-inline: auto; padding: var(--space-6) var(--space-5) var(--space-7); }
  .np-story-title:focus { outline: none; }
  /* the next story, without leaving the sheet */
  .np-story.is-swap { animation: np-fade var(--duration-exit) var(--ease-out) both; }
  .np-mail { color: var(--text); text-decoration: underline; text-decoration-thickness: var(--line-underline); text-underline-offset: 0.2em; text-decoration-color: var(--text-subtle); transition: text-decoration-color var(--duration-hover) var(--ease-hover); }
  @media (hover: hover) and (pointer: fine) { .np-mail:hover { text-decoration-color: var(--accent-strong); } }
  .np-story .lede { max-width: none; color: var(--text); }
  .np-prose { display: grid; gap: var(--space-4); }
  .np-prose p { color: var(--text-muted); max-width: var(--measure-body); text-wrap: pretty; }
  .np-prose h3 { margin-top: var(--space-4); font: 700 var(--type-heading-size)/var(--type-heading-leading) var(--font-text); letter-spacing: var(--type-heading-tracking); }
  .np-prose ul { display: grid; gap: var(--space-2); max-width: var(--measure-body); color: var(--text-muted); }
  .np-prose li { position: relative; padding-left: 1.75rem; }
  /* a bullet is a ring, as on the target */
  .np-prose li::before { content: ""; position: absolute; left: 0.2rem; top: 0.52em; width: 0.6rem; height: 0.6rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--accent-text); }
  .np-prose blockquote { display: grid; gap: var(--space-3); margin: var(--space-3) 0; padding: var(--space-5); border-radius: var(--radius-media); background: var(--bg-alt); }
  .np-prose blockquote p { font: var(--type-title-weight) var(--type-title-size)/var(--type-title-leading) var(--font-display); letter-spacing: var(--type-title-tracking); color: var(--text); max-width: none; text-wrap: balance; }
  .np-prose blockquote footer { font-size: var(--type-small-size); color: var(--text-subtle); }
  .np-flag { justify-self: start; display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: var(--radius-pill); background: var(--bg-alt); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--type-small-size); color: var(--text-subtle); }
  /* a video story: the portrait video stands in the cover's frame; the cover keeps its 3:2 so the frame is never cropped */
  .np-story-cover--video { aspect-ratio: 3 / 2 !important; }
  .np-story-video { position: absolute; top: 0; bottom: 0; left: 50%; height: 100%; width: auto; max-width: 100%; transform: translateX(-50%); background: var(--color-night); object-fit: contain; }
  /* a photo story: every slide of the post, at full width of the text column */
  .np-gallery { display: grid; gap: var(--space-4); margin: 0; padding: 0; list-style: none; }
  .np-gallery img { display: block; width: 100%; height: auto; border-radius: var(--radius-media); background: var(--bg-alt); }
  .np-play { position: absolute; z-index: 2; right: var(--space-3); bottom: var(--space-3); width: 2.5rem; height: 2.5rem; border-radius: 50%; background: rgb(0 0 0 / 0.55); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.85); pointer-events: none; }
  .np-play::after { content: ""; position: absolute; left: 53%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: 0.45rem 0 0.45rem 0.75rem; border-color: transparent transparent transparent #fff; }

  /* The way to the app, under every story: the footer's closing call in small */
  .np-get { display: grid; gap: var(--space-5); margin-top: var(--space-4); padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: var(--radius-panel); background: var(--color-night); color: var(--text); }
  .np-get-copy { display: grid; justify-items: start; gap: var(--space-3); }
  .np-get-title { font: var(--type-title-weight) var(--type-title-size)/var(--type-title-leading) var(--font-display); letter-spacing: var(--type-title-tracking); }
  .np-get-title em { display: inline-block; font-style: italic; color: var(--emphasis); }
  .np-get p { color: var(--text-muted); }
  .np-get .store-row { justify-content: flex-start; }
  .np-get .link-arrow { justify-self: start; }
  @media (min-width: 760px) { .np-get { grid-template-columns: auto minmax(0, 1fr); align-items: center; } .np-get-copy { grid-column: 1 / -1; } .np-get .link-arrow { justify-self: end; } }

  /* Newer and older: the next story without leaving the sheet */
  .np-more { display: grid; gap: var(--space-3); padding-top: var(--space-5); border-top: var(--line-hairline) solid var(--line); }
  .np-more a { display: grid; gap: 2px; min-height: 44px; align-content: center; color: inherit; }
  .np-more .label { display: inline-flex; align-items: center; gap: 6px; }
  .np-more .icon { width: 16px; height: 16px; }
  .np-more-title { font-weight: 700; }
  @media (hover: hover) and (pointer: fine) { .np-more a:hover .np-u { text-decoration-color: currentColor; } }
  .np-more a:focus-visible .np-u { text-decoration-color: currentColor; }
  @media (min-width: 600px) {
    .np-more { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-6); }
    .np-more .is-older { grid-column: 2; text-align: right; justify-items: end; }
  }

  @media (min-width: 760px) {
    .np-story-cover { aspect-ratio: 16 / 9; }
    .np-story-col { padding: var(--space-7) var(--space-6) var(--space-8); }
  }
  /* Phones: the sheet is the screen, and it comes from below */
  @media (max-width: 699.98px) {
    .np-modal { padding: 0; }
    .np-sheet { width: 100%; height: 100%; max-height: none; border-radius: 0; box-shadow: none; }
    .np-story-cover { border-radius: 0; }
    .np-story-col { padding-bottom: calc(var(--space-7) + env(safe-area-inset-bottom, 0px)); }
    .np-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; }
    @starting-style { .np-modal[open] .np-sheet { opacity: 0; transform: translateY(12%); } }
  }

  /* ───────────────────────── View transitions (set up by news-page.js, only while one runs) ─────────────────────────
     np-cover: a card's picture and the sheet's cover are the same thing. np-vt-card: a story keeps its place
     in the reader's eye while the filter changes around it. */
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--duration-nav); }
  ::view-transition-group(np-cover) { animation-duration: 420ms; animation-timing-function: var(--ease-morph); }
  ::view-transition-old(np-cover), ::view-transition-new(np-cover) { height: 100%; object-fit: cover; animation-duration: 420ms; }
  ::view-transition-group(.np-vt-card) { animation-duration: var(--duration-morph); animation-timing-function: var(--ease-morph); }
  ::view-transition-old(.np-vt-card):only-child { animation: np-vt-out var(--duration-exit) var(--ease-out) both; }
  ::view-transition-new(.np-vt-card):only-child { animation: np-vt-in var(--duration-morph) var(--ease-out) both; }
  @keyframes np-vt-out { to { opacity: 0; } }
  @keyframes np-vt-in { from { opacity: 0; transform: scale(0.96); } }
}

/* ───────────────────────── Reduced motion: colour and opacity only ───────────────────────── */
@layer utilities {
  @media (prefers-reduced-motion: reduce) {
    .np-hero .w, .np-hero .lede, .np-hero .np-momentum { animation: none; }
    .np-shot { animation: none; opacity: 0; }
    .np-bg-video { display: none; }
    .np-lead-media { animation: np-fade var(--duration-reduced) var(--ease-out) both; }
    .np-media img, .np-open .np-media { transition: none; }
    .np-open:hover .np-media img, .np-open:active .np-media { transform: none; }
    .np-sheet { transition: opacity var(--duration-reduced) var(--ease-out); }
    @starting-style { .np-modal[open] .np-sheet { transform: none; } }
    .np-progress { animation: none; transform: none; opacity: 0; }
  }
}
