/* ============================================================================
   NISE supplementary site — custom design layer (canonical academic fashion)
   Base design tokens and components; layout.css follows the widget styles.

   Look: a standard CoRL / robot-learning project page (cf. 3D Diffuser Actor,
   SAM2Act, RVT-2). White ground, near-black ink, Noto Sans throughout, a
   centered hero with rounded dark pill buttons, centered bold section headers,
   a centered, left-aligned reading column, academic-blue links, and rounded media
   cards. The chrome is deliberately quiet so the work — the interactive charts
   and the RGB-vs-raw-depth pair — carries the page's interest.

   The terracotta accent (#C4622D) lives ONLY inside the charts (the NISE data
   series); it is no longer a site-chrome colour. JetBrains Mono is reserved for
   the BibTeX block and numeric chart labels. No external assets; offline-safe.
   ========================================================================= */

/* ----------------------------------------------------------------- tokens */
:root {
  /* Ground / surface / hairline */
  --bg:        #ffffff;
  --surface:   #fafafa;
  --surface-2: #f5f5f5;
  --rule:      #ededed;
  --rule-2:    #e3e3e3;
  /* Ink */
  --ink:       #0a0a0a;
  --ink-soft:  #4a4a4a;
  --muted:     #767676;
  /* Academic link blue */
  --link:      hsl(204, 86%, 53%);
  --link-hover:hsl(204, 86%, 43%);
  /* Dark pill buttons (Nerfies/academicons convention) */
  --pill:      #363636;
  --pill-hover:#1f1f1f;
  --pill-disabled: #9a9a9a;

  --font-body: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --maxw: 1120px;
  --maxw-narrow: 800px;
  --gutter: clamp(20px, 5vw, 48px);
  --block-gap: clamp(32px, 4vw, 48px);
  --nav-h: 56px;
  --radius-pill: 290486px;   /* fully-rounded pill (Bulma's is-rounded radius) */

  --shadow-soft: 0 1px 2px rgba(10,10,10,0.04), 0 10px 30px -22px rgba(10,10,10,0.35);
  --shadow-card: 0 1px 2px rgba(10,10,10,0.05), 0 14px 34px -24px rgba(10,10,10,0.40);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------------------------------------- base reset */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 14px);
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body.nise-body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  overflow-x: hidden;
  /* Keep prose readable without forced word spacing or hyphenation. */
  -webkit-hyphens: none;
  hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
}

::selection { background: rgba(31,143,222,0.18); color: var(--ink); }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration: none; transition: color 150ms var(--ease); }
a:hover { color: var(--link-hover); text-decoration: underline; }

strong, b { font-weight: 700; }

/* shared editorial column — centered */
.nise-wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.nise-narrow { max-width: var(--maxw-narrow); margin-inline: auto; }

/* ============================================================ top nav */
.nise-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255,255,255,0.88);
  -webkit-backdrop-filter: saturate(150%) blur(9px);
  backdrop-filter: saturate(150%) blur(9px);
  border-bottom: 1px solid var(--rule);
}
.nise-nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nise-nav__brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.nise-nav__brand:hover { text-decoration: none; color: var(--ink); }
.nise-nav__brand .sc { letter-spacing: 0.02em; }
.nise-nav__links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  list-style: none;
  padding: 0;
  margin-block: 0;
}
.nise-nav__links a {
  display: inline-flex;
  align-items: center;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  padding: 0.4rem 0.7rem;
  border-radius: 7px;
  position: relative;
  transition: color 150ms var(--ease), background 150ms var(--ease);
}
.nise-nav__links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nise-nav__links a.is-active { color: var(--link); }
.nise-nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0.7rem; right: 0.7rem; bottom: 0;
  height: 2px;
  background: var(--link);
  border-radius: 2px;
}

.nise-burger {
  display: none;
  margin-left: auto;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.02rem;
}
.nise-burger:hover { background: var(--surface-2); }

/* ============================================================ section frame */
.nise-section {
  padding-block: clamp(48px, 6vw, 80px);
  position: relative;
}
.nise-section--tint { background: var(--surface); }

.nise-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* section eyebrow → small centered uppercase kicker above the title */
.nise-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.nise-eyebrow__num { display: none; }   /* the mono-numeral motif is retired */
.nise-eyebrow__label {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.nise-eyebrow__rule { display: none; }

/* centered bold section headers */
.nise-h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.4vw, 1.95rem);
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-align: center;
  margin: 0 auto 1.6rem;
  max-width: 44ch;
  text-wrap: balance;
}
.nise-h2 em { font-style: normal; }   /* no terracotta emphasis in chrome */
.nise-h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.006em;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
}

/* Body copy shares one centered reading measure. */
.nise-lead,
.nise-body-text {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink-soft);
  text-align: left;
  -webkit-hyphens: none;
  hyphens: none;
  max-width: var(--maxw-narrow);
  margin: 0 auto 1rem;
}
.nise-lead { color: var(--ink); }
.nise-body-text + .nise-body-text { margin-top: 0.9rem; }
.nise-body-text strong, .nise-lead strong { color: var(--ink); font-weight: 700; }

/* concept words: quiet bold, not a brand-coloured serif italic */
.concept { font-weight: 700; color: var(--ink); font-style: normal; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.metric { font-family: var(--font-mono); font-weight: 600; color: var(--ink); font-feature-settings: "tnum" 1; }
.metric--nise { color: var(--ink); }   /* terracotta confined to charts */

/* ============================================================ HERO (centered) */
.nise-hero {
  position: relative;
  isolation: isolate;   /* own stacking context so the bg board can't escape behind the nav */
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(28px, 4vw, 44px);
  text-align: center;
}
.nise-hero__inner {
  position: relative;
  z-index: 1;
  /* Raise the hero column cap above the body --maxw (1000px) so the wider
     title (max-width:min(1040px,92vw)) is never clipped. The kicker, author
     row, buttons and teaser all stay centered and keep their own narrower
     caps, so only the title takes advantage of the extra room. */
  max-width: 1120px;
}

/* the kicker is a small centered uppercase line; wraps between phrase groups
   on narrow viewports (each phrase stays intact via intra-phrase NBSP) so it
   never pushes the body wider than the viewport on phones. */
.nise-hero__kicker {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.2rem 0;
}
.nise-hero__kicker .dot { display: none; }

.nise-hero__title {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(2rem, 4.6vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  /* The hero title may run wider than the reading column — this is the
     standard academic-page convention (cf. 3D Diffuser Actor / SAM2Act). A
     wider cap lets the full title settle into 2–3 lines on desktop instead of
     the ~5 lines a 20ch measure forced; it narrows responsively below. */
  margin: 0 auto;
  max-width: min(1040px, 92vw);
  text-wrap: balance;
}
.nise-hero__title .lead-letter { color: inherit; font-weight: inherit; }
.nise-hero__title .sc-nise {
  letter-spacing: 0.01em;
  color: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

/* Authors, affiliations, and conference distinction. */
.nise-authors {
  margin: 1.5rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.nise-authors__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nise-authors__name {
  font-family: var(--font-body);
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.nise-authors sup {
  font-size: 0.7em;
  margin-left: 0.12em;
}
.nise-authors__affiliations {
  max-width: 760px;
  font-size: clamp(0.85rem, 1.6vw, 0.95rem);
  color: var(--ink-soft);
  line-height: 1.6;
  text-wrap: balance;
}
.nise-authors__affiliations p + p { margin-top: 0.2rem; }
.nise-authors__correspondence {
  font-size: 0.8rem;
  color: var(--muted);
}
.nise-authors__venue {
  margin-top: 0.5rem;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.5;
}
.nise-authors__spotlight {
  color: var(--ink);
  font-weight: 700;
  font-style: italic;
}

/* button row — centered rounded dark pills */
.nise-cta {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.nise-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--pill);
  background: var(--pill);
  color: #ffffff;
  cursor: pointer;
  transition: transform 150ms var(--ease), background 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease), opacity 150ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.nise-btn .icon { font-size: 1.05em; color: #ffffff; }
.nise-btn:hover {
  background: var(--pill-hover);
  border-color: var(--pill-hover);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}
.nise-btn:hover .icon { color: #ffffff; }
/* primary == same dark pill (no brand colour); kept for HTML compatibility */
.nise-btn--primary { background: var(--pill); border-color: var(--pill); color: #ffffff; }
.nise-btn--primary .icon { color: #ffffff; }
.nise-btn--primary:hover { background: var(--pill-hover); border-color: var(--pill-hover); }
/* disabled paper button — greyed, non-interactive */
.nise-btn--disabled,
.nise-btn[aria-disabled="true"] {
  background: var(--pill-disabled);
  border-color: var(--pill-disabled);
  color: #ffffff;
  cursor: not-allowed;
  opacity: 0.85;
  pointer-events: none;
}
.nise-btn--disabled .icon { color: #ffffff; }

.nise-cta__note {
  flex-basis: 100%;
  margin-top: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 400;
}
.nise-cta__note .icon { font-size: 0.85em; color: var(--muted); }

/* hero teaser */
.nise-hero__teaser {
  margin: clamp(28px, 4vw, 48px) auto 0;
  max-width: 900px;
}

/* ---------------------------------------------------------------- HERO BG BOARD
   Edge-framed background board (variant v3): real-robot task scenes hug the
   hero's LEFT / RIGHT edge columns plus a faint TOP band, all feathered toward
   a clean WHITE center where the title sits. Sits at z-index:0 behind
   .nise-hero__inner (z-index:1); pointer-events:none so it never intercepts
   clicks or text selection. A white veil + center-clearing radial scrim drive
   the title region to near-pure-white for unmistakable contrast. All imagery
   is local (static/images/...) — no external refs. */
.nise-herobg {
  position: absolute;
  inset: 0;
  z-index: 0;                /* behind .nise-hero__inner (z-index:1) */
  overflow: hidden;
  pointer-events: none;      /* never intercepts clicks / selection */
  background: var(--bg);     /* white ground beneath everything */
}

/* the imagery frame: edge columns + a top band. Each panel is a faded
   real-robot still, slightly desaturated and run very low-opacity so it reads
   as quiet context, not a photo wall. The center is left empty; the scrim
   below guarantees the title sits on near-pure-white regardless of content. */
.nise-herobg__edges {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
}
.nise-herobg__col {
  position: relative;
  width: 30%;                /* left / right thirds; center ~40% clear */
  height: 100%;
  overflow: hidden;
}
.nise-herobg__band {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 28%;               /* faint top band spanning full width */
  overflow: hidden;
}

/* shared panel image treatment */
.nise-herobg__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.14;             /* ~12–16% target */
  filter: saturate(0.78) contrast(1.02);
  display: block;
  mix-blend-mode: multiply;  /* lift toward the ground tone so darks don't punch */
}
.nise-herobg__col .nise-herobg__img { opacity: 0.13; }   /* edge columns carry the frame */
.nise-herobg__band .nise-herobg__img { opacity: 0.06; }  /* top band is the faintest accent */

/* per-edge feather: fade each column toward the CENTER. Left column fades on
   its RIGHT edge; right column on its LEFT edge; top band fades toward the
   BOTTOM — keeping the imagery hugging the outer frame and clearing the title. */
.nise-herobg__col--left .nise-herobg__img {
  -webkit-mask-image: linear-gradient(to right,
    rgba(0,0,0,1) 0%, rgba(0,0,0,0.92) 32%, rgba(0,0,0,0.35) 72%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to right,
    rgba(0,0,0,1) 0%, rgba(0,0,0,0.92) 32%, rgba(0,0,0,0.35) 72%, rgba(0,0,0,0) 100%);
}
.nise-herobg__col--right .nise-herobg__img {
  -webkit-mask-image: linear-gradient(to left,
    rgba(0,0,0,1) 0%, rgba(0,0,0,0.92) 32%, rgba(0,0,0,0.35) 72%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to left,
    rgba(0,0,0,1) 0%, rgba(0,0,0,0.92) 32%, rgba(0,0,0,0.35) 72%, rgba(0,0,0,0) 100%);
}
.nise-herobg__band .nise-herobg__img {
  -webkit-mask-image: linear-gradient(to bottom,
    rgba(0,0,0,1) 0%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to bottom,
    rgba(0,0,0,1) 0%, rgba(0,0,0,0.55) 55%, rgba(0,0,0,0) 100%);
}

/* CENTER-CLEARING SCRIM: a radial white wash centered on the title region
   drives the middle of the hero to near-pure-white for unmistakable contrast,
   while letting the corners keep their faint imagery. */
.nise-herobg__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 46%,
      rgba(255,255,255,0.985) 0%,
      rgba(255,255,255,0.95) 38%,
      rgba(255,255,255,0.66) 60%,
      rgba(255,255,255,0.22) 80%,
      rgba(255,255,255,0) 100%);
}
/* a second, gentle full-bleed white veil keeps even the framed imagery
   restrained against the formal page (belt-and-braces). */
.nise-herobg__veil {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.30);
}

/* a single hairline signal accent: a 1px tinted rule along the very bottom of
   the board, picking up the chart terracotta at low strength. */
.nise-herobg__hair {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(to right,
    rgba(196,98,45,0) 0%,
    rgba(196,98,45,0.22) 22%,
    rgba(196,98,45,0.28) 50%,
    rgba(196,98,45,0.22) 78%,
    rgba(196,98,45,0) 100%);
}

/* On narrow viewports the title column dominates; pull the edge imagery in
   tighter and lean harder on the scrim so the stacked title never loses
   contrast. */
@media (max-width: 760px) {
  .nise-herobg__col { width: 34%; }
  .nise-herobg__col .nise-herobg__img { opacity: 0.11; }
  .nise-herobg__band { height: 26%; }
  .nise-herobg__scrim {
    background:
      radial-gradient(ellipse 78% 86% at 50% 44%,
        rgba(255,255,255,0.98) 0%,
        rgba(255,255,255,0.93) 40%,
        rgba(255,255,255,0.6) 66%,
        rgba(255,255,255,0) 100%);
  }
}
/* On very small phones the edge imagery competes with the title — hide it and
   keep the pure-white canonical ground. The board element stays (white base),
   so the layout is unchanged. */
@media (max-width: 480px) {
  .nise-herobg__edges,
  .nise-herobg__band { display: none; }
}

.nise-figure { margin: 0; }
.nise-figure__frame {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.nise-figure__frame img { border-radius: 12px; width: 100%; display: block; }
/* Figure captions use the same reading measure as the prose. */
.nise-figure__cap {
  margin: 1rem auto 0;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: var(--maxw-narrow);
  text-align: left;
}
.nise-figure__cap b, .nise-figure__cap strong { color: var(--ink); font-weight: 700; font-style: normal; }
.nise-figure__cap .lbl { font-family: var(--font-mono); font-weight: 600; color: var(--ink-soft); font-size: 0.92em; font-style: normal; }
.nise-figure--narrow { max-width: 760px; margin-inline: auto; }

/* ============================================================ corruption pair */
.nise-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
  margin: 1.8rem auto 0;
  max-width: 820px;
}
.nise-pair__cell { margin: 0; }
.nise-pair__media {
  position: relative;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.nise-pair__media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.nise-pair__tag {
  position: absolute;
  top: 10px; left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  padding: 0.24rem 0.5rem;
}
.nise-pair__tag .n { display: none; }   /* drop the mono "01/02" numeral */
.nise-pair__cap {
  margin-top: 0.7rem;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: center;
}
.nise-pair__cap b { color: var(--ink); font-weight: 700; font-style: normal; }

/* corruption-family chips (centered) */
.nise-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin: 1.5rem auto 0;
  max-width: 820px;
}
.nise-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.9rem;
}
.nise-chip .k {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

/* ============================================================ method */
/* "the thinking" lead — a quiet centered intro paragraph (no brand rail) */
.nise-thinking {
  border: 0;
  padding: 0;
  margin: 0 auto 0.5rem;
  max-width: var(--maxw-narrow);
  text-align: center;
}
.nise-thinking__tag {
  font-family: var(--font-body);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  display: block;
  margin-bottom: 0.55rem;
}
.nise-thinking p {
  color: var(--ink-soft);
  margin: 0 auto;
  text-align: left;
}

/* ----------------------------------------------------- interactive pipeline */
/* The framework figure stays the authoritative camera-ready image; %-positioned
   hotspot buttons overlay it (scaling with the responsive image) and a compact
   tooltip, anchored to the active box and auto-flipped to stay in frame,
   reflects the hovered / focused / tapped component. Canonical chrome: Noto
   Sans, white surface, ink hairlines — no chart accent. */
.nise-pipe { position: relative; }
.nise-pipe__diagram { position: relative; }

.nise-pipe__spots {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.nise-pipe__spot {
  position: absolute;
  /* left / top / width / height are set inline as percentages of the image. */
  margin: 0;
  padding: 0;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms var(--ease), border-color 160ms var(--ease),
              box-shadow 160ms var(--ease);
  /* keep the button itself invisible until interacted with */
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}
/* subtle reveal on hover / keyboard-focus / lock — a faint ink tint + hairline,
   never the terracotta chart accent */
.nise-pipe__spot:hover,
.nise-pipe__spot:focus-visible,
.nise-pipe__spot.is-active {
  background: rgba(10, 10, 10, 0.045);
  border-color: rgba(10, 10, 10, 0.42);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}
/* keyboard focus gets a slightly stronger ring for visibility */
.nise-pipe__spot:focus-visible {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(31, 143, 222, 0.22);
}
.nise-pipe__spot.is-active {
  border-color: var(--ink);
}

/* compact rationale tooltip — a small white card anchored to the active box.
   Positioned in pixels by pipeline.js relative to the figure frame; auto-flips
   above/below and clamps to the frame edges. */
.nise-pipe__tip {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  max-width: 300px;
  width: max-content;
  background: #fff;
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  padding: 0.7rem 0.8rem 0.72rem;
  text-align: left;
  box-shadow: 0 2px 6px rgba(10,10,10,0.06), 0 14px 32px -16px rgba(10,10,10,0.45);
  pointer-events: none;   /* the tooltip never steals hover from the hotspots */
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}
.nise-pipe__tip[hidden] { display: none; }
.nise-pipe__tip.is-visible { opacity: 1; transform: none; }
.nise-pipe__tip.is-below { transform: translateY(3px); }
.nise-pipe__tip.is-below.is-visible { transform: none; }

/* Keep explanations below the small diagram on phones. Hotspots remain anchored
   to the image-only wrapper, so opening a tooltip cannot change their geometry. */
@media (max-width: 680px) {
  .nise-pipe__tip {
    position: static;
    width: auto;
    max-width: none;
    margin: 0.75rem 8px 8px;
    box-shadow: none;
    transform: none;
  }
  .nise-pipe__tip-arrow { display: none; }
}

.nise-pipe__tip-head {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.nise-pipe__tip-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.25;
  letter-spacing: -0.003em;
  color: var(--ink);
}
.nise-pipe__tip-tag {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}
.nise-pipe__tip-tag[hidden] { display: none; }
.nise-pipe__tip-text {
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
  text-align: left;
}
/* little arrow nub: a rotated square that picks up the card's border + ground.
   Default (tooltip above the box) -> arrow on the bottom edge pointing down;
   .is-below (tooltip under the box) -> arrow on the top edge pointing up. */
.nise-pipe__tip-arrow {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 1px solid var(--rule-2);
  transform: translateX(-50%) rotate(45deg);
}
.nise-pipe__tip:not(.is-below) .nise-pipe__tip-arrow {
  bottom: -5px;
  border-top: 0;
  border-left: 0;
}
.nise-pipe__tip.is-below .nise-pipe__tip-arrow {
  top: -5px;
  border-bottom: 0;
  border-right: 0;
}

/* figure <-> card link: the active GCVSS / GM3A hotspot softly emphasizes its
   contribution card below (border + ground), no layout shift. */
.nise-card.is-linked {
  border-color: rgba(10,10,10,0.42);
  background: #fff;
  box-shadow: 0 1px 2px rgba(10,10,10,0.05), 0 0 0 2px rgba(10,10,10,0.05), 0 14px 34px -24px rgba(10,10,10,0.40);
}

@media (prefers-reduced-motion: reduce) {
  .nise-pipe__spot, .nise-pipe__tip, .nise-card { transition: none; }
  .nise-pipe__tip { transform: none !important; }
}

/* two module cards (the contribution spotlight) */
.nise-modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin: 2rem auto 0;
  max-width: 100%;
}
.nise-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: clamp(20px, 2.6vw, 28px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}
.nise-card::before { content: none; }   /* drop the coloured accent bar */
.nise-card--gcvss, .nise-card--gm3a { --accent: var(--ink); }

.nise-card__top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.nise-card__badge {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: var(--pill);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.65rem;
  line-height: 1.3;
}
.nise-card__phase {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
}
.nise-card__phase .icon { color: var(--muted); margin-right: 0.3rem; }
.nise-card__title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.16rem;
  line-height: 1.22;
  letter-spacing: -0.006em;
  color: var(--ink);
  margin: 0 0 0.6rem 0;
}
.nise-card__title em { font-style: normal; color: var(--ink); }
.nise-card__body { color: var(--ink-soft); font-size: 0.97rem; line-height: 1.6; margin: 0; text-align: left; }
.nise-card__body strong { color: var(--ink); font-weight: 700; }

/* muted ablation note (centered, narrow) */
.nise-note {
  margin: 1.8rem auto 0;
  max-width: var(--maxw-narrow);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  text-align: center;
}
.nise-note .nise-tag {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-right: 0.5rem;
}
.nise-note .metric { font-size: 0.92rem; }

/* ============================================================ results shells */
.nise-cliff-figure { margin: var(--block-gap) auto 0; }
.nise-cliff-figure__title {
  margin-bottom: 1.4rem;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
  text-align: center;
}
.nise-cliff-figure__image { display: block; }
.nise-cliff-figure__image img { width: 100%; height: auto; }
.nise-cliff-figure__image:focus-visible { outline: 2px solid var(--link); outline-offset: 6px; }
.nise-cliff-figure__stack { display: none; }
@media (max-width: 640px) {
  .nise-cliff-figure__wide { display: none; }
  .nise-cliff-figure__stack { display: grid; gap: 1.5rem; }
}

.nise-chart-shell {
  margin: 1.8rem auto 0;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: clamp(18px, 2.6vw, 30px);
  box-shadow: var(--shadow-card);
}
.nise-chart-caption {
  margin: 1rem auto 0;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: var(--maxw-narrow);
  text-align: left;
}
.nise-chart-caption b { color: var(--ink); font-weight: 700; font-style: normal; }

/* Layout guard (custom layer only): the chart engine pins its replay pill to the
   shell's top-right (position:absolute) AND right-aligns its header note via
   margin-left:auto. On wide shells those two can collide. Reserve clearance for
   the pill so the engine's note wraps cleanly beneath it. Pure spacing — does not
   touch chart data or the engine's own rules. */
.nise-chart-shell { position: relative; }
.nise-chart-shell .nise-chart__head { padding-right: 7.5rem; }
.nise-chart-shell .nise-chart__note { margin-top: 0.15rem; }
@media (max-width: 760px) {
  /* On narrow viewports the replay pill flows inline (see charts.css), so the
     head no longer needs the desktop clearance reserved for an absolute pill. */
  .nise-chart-shell .nise-chart__head { padding-right: 0; }
}

/* headline stat — quiet neutral card (no terracotta wash) */
.nise-headline-stat {
  margin: 1.5rem auto 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  padding: 0.9rem 1.2rem;
  max-width: 820px;
  text-align: center;
}
.nise-headline-stat .big {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--ink);
  line-height: 1;
  font-feature-settings: "tnum" 1;
}
.nise-headline-stat .txt {
  font-family: var(--font-body);
  font-size: 0.94rem;
  color: var(--ink-soft);
  line-height: 1.5;
  text-align: left;
}
.nise-headline-stat .txt b { color: var(--ink); font-weight: 700; }

/* ============================================================ real-robot setup */
.nise-framework, .nise-setup { margin: 2rem auto 0; }

/* video tile grid (rollouts) */
.nise-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin: 2.2rem auto 0;
}
.nise-tile {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.nise-tile__group {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 3;
  font-family: var(--font-body);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255,255,255,0.92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  padding: 0.2rem 0.46rem;
}
/* the drop-in video slot: .video-poster is replaced 1:1 by a <video> element */
.video-poster {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.video-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* a quiet neutral poster where no still exists (no brand gradient) */
.video-poster--gradient {
  background: linear-gradient(160deg, #2b2b2b, #161616);
}
.video-poster--gradient::after { content: none; }
.video-poster__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.04) 0%, rgba(10,10,10,0.26) 64%, rgba(10,10,10,0.56) 100%);
  z-index: 1;
}
.video-poster__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  text-align: center;
  padding: 1rem;
}
.video-poster__play {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pill);
  font-size: 1rem;
  box-shadow: 0 6px 22px -8px rgba(0,0,0,0.5);
  transition: transform 200ms var(--ease), background 200ms var(--ease);
  padding-left: 3px;
}
.nise-tile:hover .video-poster__play { transform: scale(1.07); background: #fff; }
.video-poster__coming {
  font-family: var(--font-body);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
.nise-tile__meta {
  padding: 0.85rem 1rem 1rem;
  background: #fff;
  border-top: 1px solid var(--rule);
}
.nise-tile__name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.0rem;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.5rem 0;
}
.nise-tile__material {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-pill);
  padding: 0.24rem 0.6rem;
  text-transform: none;
}
.nise-tile__material .icon { color: var(--muted); font-size: 0.85em; }

/* ============================================================ footer */
.nise-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.4rem;
  margin-top: 0;
}
.nise-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
}
.nise-footer__brand {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--ink);
}
.nise-footer__brand .sc { letter-spacing: 0.02em; }
.nise-footer__note, .nise-footer__credit {
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--muted);
}
.nise-footer__credit { margin-left: 0; }

/* ============================================================ reveal motion */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

/* orchestrated hero load: title -> author -> buttons -> teaser */
.hero-stagger { opacity: 0; transform: translateY(16px); }
.nise-loaded .hero-stagger {
  animation: heroIn 600ms var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes heroIn {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-stagger { opacity: 1 !important; transform: none !important; animation: none !important; }
  .nise-tile:hover .video-poster__play,
  .nise-btn:hover { transform: none; }
}

/* ============================================================ responsive */
@media (max-width: 900px) {
  .nise-modules { grid-template-columns: 1fr; gap: 1.1rem; }
  .nise-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nise-nav__links { display: none; }
  .nise-burger { display: inline-flex; }
  .nise-nav__links.is-open {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem clamp(20px, 5vw, 48px) 0.9rem;
    box-shadow: var(--shadow-soft);
  }
  .nise-nav__links.is-open a { padding: 0.7rem 0.2rem; border-radius: 0; }
  .nise-nav__links.is-open li + li { border-top: 1px solid var(--rule); }
  .nise-nav__links.is-open a.is-active::after { display: none; }
}
@media (max-width: 680px) {
  body.nise-body { font-size: 16px; }
  .nise-pair { grid-template-columns: 1fr; }
  .nise-tiles { grid-template-columns: 1fr; }
  .nise-headline-stat { align-items: flex-start; text-align: left; }
  .nise-lead, .nise-body-text, .nise-thinking p, .nise-chart-caption,
  .nise-figure__cap, .nise-pair__cap { text-align: left; }
}
@media (max-width: 400px) {
  .nise-cta { gap: 0.5rem; }
  .nise-btn { padding: 0.55rem 0.95rem; font-size: 0.9rem; }
}
