/* ============================================================
   Fermioniq — front-end design system
   Tokens & rules from specs/design.md
   ============================================================ */

:root {
  /* Core palette */
  --purple-soft: #B7ABF6;
  --lavender-grey: #DCD8EE;
  --acid-lime-soft: #E4E991;
  --deep-navy: #091220;
  --off-white: #F3F3F5;
  --electric-purple: #5C37F2;
  --electric-lime: #EFF012;

  /* Roles */
  --ink: var(--deep-navy);
  --ink-2: rgba(9, 18, 32, 0.68);
  --ink-3: rgba(9, 18, 32, 0.46);
  --line: var(--lavender-grey);
  --line-soft: rgba(220, 216, 238, 0.55);
  --surface: var(--off-white);
  --surface-2: #ffffff;
  --accent: var(--electric-purple);
  --accent-hover: #4A2BD6;
  --on-dark: #ffffff;
  --on-dark-2: #C1BADA;
  --signal: var(--electric-lime);

  /* Type */
  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-micro: 150ms;
  --t-std: 250ms;

  --header-h: 76px;
  --radius: 16px;
  --radius-sm: 10px;
}

/* ---------- Reset / base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }

button { font: inherit; cursor: pointer; }

::selection { background: var(--electric-purple); color: #fff; }

:focus-visible {
  outline: 2px solid var(--electric-purple);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--deep-navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 10px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

.display {
  font-size: clamp(2.6rem, 6vw, 3.5rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.h1 { font-size: clamp(2.1rem, 4.6vw, 3rem); letter-spacing: -0.01em; }
.h2 { font-size: clamp(1.7rem, 3.4vw, 2.25rem); }
.h3 { font-size: 1.5rem; }

p { margin: 0 0 1em; }

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 56ch;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.09em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.eyebrow--lime { color: #b8c20a; }
.eyebrow--on-dark { color: var(--signal); }

/* ---------- Layout helpers ---------- */

.container {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
}

.section { padding-block: clamp(80px, 11vw, 140px); }
.section--tight { padding-block: clamp(56px, 8vw, 96px); }
.section--bottom-lg { padding-bottom: clamp(120px, 16vw, 200px); }

.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
/* Splits the section head into a baseline-aligned row spanning the full container */
.section-head--split {
  max-width: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.section-head--split .text-link { margin-left: auto; }

@media (max-width: 900px) {
  .section-head--split { flex-direction: column; align-items: flex-start; }
  .section-head--split .text-link { margin-left: 0; }
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 2.5vw, 2rem); }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  transition: background var(--t-std) var(--ease), color var(--t-std) var(--ease),
              border-color var(--t-std) var(--ease), transform var(--t-micro) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--electric-purple); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }

.btn-ghost-dark { background: #fff; color: var(--ink); }
.btn-ghost-dark:hover { background: var(--off-white); color: var(--ink); }

.btn-sm { padding: 10px 20px; font-size: 0.875rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
  transition: color var(--t-std) var(--ease);
}
.text-link::after {
  content: '→';
  font-family: var(--font-mono);
  transition: transform var(--t-std) var(--ease);
}
.text-link:hover { color: var(--accent); }
.text-link:hover::after { transform: translateX(4px); }
.text-link--light { color: #fff; }
.text-link--light:hover { color: var(--signal); }
/* Back links carry their own left arrow in the text; no trailing arrow */
.text-link--back::after { content: none; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 243, 245, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img, .brand svg { height: 34px; width: auto; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  position: relative;
  padding: 9px 14px;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 8px;
  transition: color var(--t-std) var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current='page'] { color: var(--ink); }
.site-nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--electric-purple);
}

.header-cta { flex-shrink: 0; }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 1.8px;
  background: var(--ink);
  transition: transform var(--t-std) var(--ease), top var(--t-std) var(--ease);
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 24px; }
.nav-toggle[aria-expanded='true'] span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.nav-toggle[aria-expanded='true'] span:nth-child(2) { top: 20px; transform: rotate(-45deg); }

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 12px 24px 28px;
}
.mobile-nav a {
  display: block;
  padding: 14px 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
}
.mobile-nav a[aria-current='page'] { color: var(--accent); }

@media (max-width: 1023px) {
  .site-nav { display: none; }
  .nav-toggle { display: block; }
  .header-cta { margin-left: auto; }
  .nav-toggle { margin-left: 0; }
  .site-header.nav-open .mobile-nav { display: block; }
}

@media (max-width: 520px) {
  .header-inner { gap: 14px; }
  .header-cta { padding: 9px 16px; font-size: 0.8rem; }
}

/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  overflow: clip;
  min-height: calc(100svh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Background image is CMS-editable (hero section → Background image);
     the gradient remains as a loading fallback underneath the image. */
  background: var(--hero-bg-image, none) center / cover no-repeat, linear-gradient(155deg, var(--off-white) 8%, #e2ddf5 48%, var(--purple-soft) 88%);
  padding-block: clamp(90px, 14vh, 160px) clamp(40px, 7vh, 80px);
}

/* White scrim (50%) over the background image, behind the content */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.hero-graphic {
  /* Homepage hero background image is set per-section in the CMS;
     the generated waveform is hidden here but remains for other slots. */
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero-graphic svg { width: 100%; height: 100%; }

.hero-content { position: relative; z-index: 10; }

.hero .lede { max-width: 52ch; }

/* Hero entrance — fade-up, staggered */
[data-animate-hero] > * {
  opacity: 0;
  transform: translateY(12px);
  animation: fade-up 550ms var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 95ms);
}
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }

/* ---------- Page hero (inner pages, compact navy) ---------- */

.page-hero {
  background: var(--deep-navy);
  color: var(--on-dark);
  padding-block: clamp(72px, 11vw, 128px) clamp(56px, 8vw, 96px);
}
.page-hero h1 { color: #fff; margin-bottom: 0.35em; }
.page-hero .lede { color: var(--on-dark-2); margin-bottom: 0; }
.page-hero .eyebrow { color: var(--signal); }

.anchor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2.4rem;
}
.anchor-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  color: var(--on-dark-2);
  border: 1px solid rgba(193, 186, 218, 0.35);
  padding: 9px 16px;
  border-radius: 999px;
  transition: color var(--t-std) var(--ease), border-color var(--t-std) var(--ease);
}
.anchor-nav a:hover { color: #fff; border-color: #fff; }

/* ---------- Editorial rows (stack / use cases) ---------- */

.rows { border-top: 1px solid var(--line); }

.row-item {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 0.9fr) minmax(0, 1.3fr) 2rem;
  align-items: baseline;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.6rem, 3vw, 2.4rem) 0.4rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  transition: background var(--t-std) var(--ease), padding var(--t-std) var(--ease);
}
a.row-item:hover { background: var(--surface-2); padding-left: 1rem; }

.row-index { color: var(--ink-3); margin-top: -4px; }
.row-name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
a.row-item:hover .row-name { color: var(--accent); }
.row-desc { color: var(--ink-2); margin: -4px 0 0; max-width: 46ch; }
.row-arrow {
  font-family: var(--font-mono);
  color: var(--ink-3);
  margin-top: -4px;
  transition: transform var(--t-std) var(--ease), color var(--t-std) var(--ease);
}
a.row-item:hover .row-arrow { transform: translateX(5px); color: var(--accent); }

@media (max-width: 760px) {
  .row-item { grid-template-columns: 2.4rem 1fr 1.4rem; }
  .row-desc { grid-column: 2 / 3; grid-row: 2; margin-top: 0.5rem; }
  .row-arrow { grid-row: 1; grid-column: 3; }
}

/* ---------- Problem strip ---------- */

.problem {
  background: var(--surface-2);
  border-block: 1px solid var(--line-soft);
}
.problem .grid-2 { align-items: start; }
.problem-statement {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ---------- Dark section ---------- */

.dark-section {
  background: var(--deep-navy);
  color: var(--on-dark);
}
.dark-section h2, .dark-section h3 { color: #fff; }
.dark-section .lede, .dark-section p { color: var(--on-dark-2); }

.partner-banner { padding-block: clamp(2.5rem, 5vw, 4rem); }

/* ---------- Scroll story (pinned header — progressive text build) ---------- */

.scroll-story {
  position: relative;
  height: 400vh;
  background: #ffffff;
}

.scroll-story-pin {
  position: sticky;
  top: var(--header-h);
  height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: clip;
  padding-top: clamp(2rem, 6vh, 4rem);
  padding-bottom: clamp(1.25rem, 3vh, 2.5rem);
  background: #ffffff;
}

/* Content (lines + CTA) stacks above the meta row (z-index 3): on short/small
   viewports they can overlap, and primary content must win (and stay clickable). */
.scroll-story-pin .container { position: relative; z-index: 4; }

/* Diagonal gradient scrim over the background and videos, behind text/CTA. */
.scroll-story-pin::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(135deg, #e3ddf8, #ffffff);
  opacity: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* Static meta row, always visible at the bottom of the pin (not part of the scrub animation) */
.scroll-story-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  z-index: 3;
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  color: rgba(9, 18, 32, 0.62);
  text-transform: uppercase;
}
.scroll-story-meta span { display: inline-flex; align-items: center; gap: 26px; }
.scroll-story-meta span + span::before { content: '·'; margin-right: 0; color: rgba(9, 18, 32, 0.35); }

/* Three looping videos on the right half of the scroll-story pin.
   Position/size are placeholders — refined later per the brief. */
.scroll-story-videos {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50%;
  z-index: 1;
  pointer-events: none;
}
.scroll-story-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 400ms var(--ease);
}
.scroll-story-video.is-active { opacity: 1; }

/* A dedicated white veil keeps text readable when the video spans the
   full section behind the lines on small screens. */
@media (max-width: 900px) {
  .scroll-story-videos { left: 0; width: 100%; }
  .scroll-story-videos::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
  }
  .scroll-story-meta span + span::before { content: none; }
}

.scroll-line {
  --reveal: 0;
  --past: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 clamp(0.75rem, 2vh, 1.5rem);
  max-width: 30ch;
  color: var(--deep-navy);
  font-size: calc(clamp(1.6rem, min(4.6vw, 6vh), 3.4rem) - (clamp(1.6rem, min(4.6vw, 6vh), 3.4rem) - clamp(1.575rem, 2.85vw, 2.1rem)) * var(--past));
}

/* Fail-visible: the scrub-driven visibility only applies once JS has taken
   over (.is-live). Without working JS the lines and CTA simply stay shown —
   a broken animation must never hide content. */
.scroll-story.is-live .scroll-line {
  opacity: var(--reveal);
  transform: translateY(calc((1 - var(--reveal)) * 28px));
}
.scroll-story.is-live .scroll-line:first-child { --reveal: 1; }

.scroll-cta {
  --reveal: 0;
  margin-top: clamp(2.25rem, 6vh, 4.5rem);
}
.scroll-story.is-live .scroll-cta {
  opacity: var(--reveal);
  transform: translateY(calc((1 - var(--reveal)) * 28px));
  pointer-events: none;
}

/* CTA becomes interactive once fully revealed */
.scroll-story.is-live .scroll-cta:not([data-reveal-zero]) { pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .scroll-story { height: auto; }
  .scroll-story-pin { position: static; height: auto; min-height: 0; padding-block: clamp(6rem, 15vh, 11rem); display: block; }
  .scroll-story-meta { position: static; bottom: auto; margin-top: 2rem; }
  .scroll-line, .scroll-line:first-child, .scroll-cta {
    --reveal: 1;
    --past: 0;
    opacity: 1;
    transform: none;
  }
  .scroll-story-video { transition: none; }
  .scroll-cta { pointer-events: auto; }
}

.mission-statement {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.3rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #fff;
  max-width: 22ch;
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid rgba(193, 186, 218, 0.22);
}
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }

.stat-value {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  font-weight: 500;
  color: var(--signal);
  letter-spacing: -0.02em;
}
.stat-label { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--on-dark-2); }

.partners { margin-top: clamp(3rem, 6vw, 4.5rem); }
.partners-label { color: rgba(193, 186, 218, 0.7); margin-bottom: 1.4rem; text-transform: uppercase; }

/* Full-width logo marquee ("lichtkrant"): continuous right-to-left loop.
   The track holds two identical groups (rendered server-side); animating
   0 → -50% makes the loop seamless at any logo count. */
.partners-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.partners-track {
  display: flex;
  width: max-content;
  animation: partners-scroll 40s linear infinite; /* fallback — site.js sets a width-based duration */
}
.partners-group {
  display: flex;
  align-items: center;
  gap: clamp(3.5rem, 7vw, 6rem);
  /* right padding == gap, so -50% lines up pixel-perfect with the next group */
  padding: 0 clamp(3.5rem, 7vw, 6rem) 0 0;
  margin: 0;
  list-style: none;
}
.partners-group li {
  display: flex;
  align-items: center;
}
.partners-group img {
  display: block;
  width: auto;
  height: clamp(39px, 4.5vw, 60px);
  opacity: 0.85;
}
.partners-marquee:hover .partners-track { animation-play-state: paused; }

@keyframes partners-scroll {
  to { transform: translateX(-50%); }
}

/* Reduced motion: no animation; keep all logos reachable via horizontal scroll */
@media (prefers-reduced-motion: reduce) {
  .partners-marquee { overflow-x: auto; }
  .partners-track { animation: none; }
}

.dark-link-row { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* ---------- CTA band ---------- */

.cta-band {
  position: relative;
  overflow: clip;
  /* Background image is CMS-editable (CTA band section → Background image);
     the gradient remains as a loading fallback underneath the image. */
  background: var(--cta-bg-image, none) center / cover no-repeat, linear-gradient(115deg, var(--acid-lime-soft) 0%, #b9c47a 30%, var(--electric-purple) 100%);
  color: var(--ink);
}

/* White scrim (50%) over the background image, behind the content */
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}
.cta-band .container {
  position: relative;
  z-index: 10;
  padding-block: clamp(80px, 11vw, 130px);
  max-width: 1200px;
}
.cta-band h2 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  letter-spacing: -0.01em;
  max-width: 15ch;
}
.cta-band p:not(.eyebrow) { max-width: 46ch; color: rgba(9, 18, 32, 0.75); font-size: 1.05rem; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-top: 2rem; }

.cta-graphic {
  /* CTA band background image is set per-section in the CMS; the
     generated waveforms are hidden here but remain for other slots. */
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cta-graphic svg { width: 100%; height: 100%; }

/* ---------- Panels & cards ---------- */

.panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.4rem);
}

.visual-panel {
  position: relative;
  overflow: clip;
  border-radius: var(--radius);
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  padding: 1.4rem;
}
.visual-panel .mono { color: rgba(255, 255, 255, 0.85); }
.bg-gradient-lime-purple { background: linear-gradient(140deg, var(--acid-lime-soft), var(--purple-soft)); }
.bg-gradient-lime-lilac { background: linear-gradient(140deg, var(--acid-lime-soft), var(--lavender-grey)); }
.bg-gradient-purple-electric { background: linear-gradient(140deg, var(--purple-soft), var(--electric-purple)); }
.bg-gradient-soft-lime { background: linear-gradient(140deg, var(--acid-lime-soft), var(--off-white)); }
.bg-gradient-hero { background: linear-gradient(140deg, var(--purple-soft), var(--off-white)); }

.visual-panel .panel-graphic {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}
.visual-panel .panel-graphic svg { width: 100%; height: 100%; }
.visual-panel .mono { position: relative; z-index: 2; }

/* ---------- Product sections ---------- */

.product-section { border-top: 1px solid var(--line); }
.product-section .grid-2 { align-items: start; }

.cap-list {
  list-style: none;
  margin: 1.8rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.cap-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.95rem;
}
.cap-list li::before {
  content: '→';
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.flow-strip {
  margin-top: 1.8rem;
  background: var(--deep-navy);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  overflow-x: auto;
}
.flow-strip code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--acid-lime-soft);
  white-space: nowrap;
}
.flow-strip code em { color: rgba(193, 186, 218, 0.75); font-style: normal; }

.spec-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.6rem; }
.spec-chips span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 7px 12px;
  border-radius: 999px;
}

/* Stack equation (products integrated value) */
.equation {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
@media (max-width: 760px) { .equation { grid-template-columns: 1fr; } }
.equation-item { border-top: 1px solid rgba(193, 186, 218, 0.25); padding-top: 1.4rem; }
.equation-item h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.equation-item .mono { color: var(--signal); display: block; margin-bottom: 0.7rem; }
.equation-item p { font-size: 0.95rem; margin: 0; }

/* ---------- Use cases ---------- */

.case-block { border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 5rem); }
.case-block .grid-2 { align-items: center; }
.case-meta { color: var(--accent); margin-bottom: 1rem; display: block; }
.case-detail { border-top: 1px solid var(--line-soft); padding-top: 1.1rem; margin-top: 1.1rem; }
.case-detail .mono { color: var(--ink-3); display: block; margin-bottom: 0.35rem; }
.case-detail p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
.case-related { margin-top: 1.6rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.case-related .mono { color: var(--ink-3); margin-right: 6px; }

/* ---------- Research ---------- */

.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.6rem, 4vw, 3.5rem);
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: clip;
  color: inherit;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.featured-post .featured-visual { min-height: 320px; height: 100%; }
.featured-post .featured-body { padding: clamp(1.6rem, 3vw, 2.6rem); }
.featured-post h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
.featured-post p { color: var(--ink-2); }
@media (max-width: 860px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-post .featured-visual { min-height: 200px; }
}

.post-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  color: var(--ink-3);
  margin-bottom: 1rem;
}
.post-meta .type { color: var(--accent); }

.post-row {
  display: grid;
  grid-template-columns: 9rem 9rem minmax(0, 1fr) 2rem;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: baseline;
  padding: 1.8rem 0.4rem;
  border-bottom: 1px solid var(--line);
  color: inherit;
  transition: background var(--t-std) var(--ease), padding var(--t-std) var(--ease);
}
a.post-row:hover { background: var(--surface-2); padding-left: 1rem; }
.post-row .post-type { color: var(--accent); }
.post-row .post-date { color: var(--ink-3); }
.post-row .row-name { font-size: clamp(1.15rem, 2.2vw, 1.45rem); }
.post-row .excerpt { grid-column: 3 / 4; margin: 0.4rem 0 0; color: var(--ink-2); font-size: 0.95rem; max-width: 60ch; }
@media (max-width: 700px) {
  .post-row { grid-template-columns: auto 1fr 1.4rem; }
  .post-row .post-type { grid-area: 1 / 1; }
  .post-row .post-date { grid-area: 1 / 2; }
  .post-row .row-name { grid-area: 2 / 1 / 2 / 3; }
  .post-row .excerpt { grid-area: 3 / 1 / 3 / 3; }
  .post-row .row-arrow { grid-area: 1 / 3; }
}

/* Updates filter (research index) */
.updates-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.filter-btn {
  position: relative;
  padding: 9px 0;
  border: 0;
  background: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: color var(--t-std) var(--ease);
}
.filter-btn:hover { color: var(--ink); }
.filter-btn.is-active { color: var(--ink); }
/* active state: purple underline, same as the active top-nav item */
.filter-btn.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--electric-purple);
}
.filter-empty { color: var(--ink-3); padding: 2rem 0.4rem; }

/* Article body */
.article-hero { padding-block: clamp(64px, 9vw, 110px) clamp(40px, 6vw, 64px); }
.article-hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  text-transform: none;
  max-width: 20ch;
}
.prose { max-width: 68ch; }
.prose p { line-height: 1.75; color: var(--ink-2); margin-bottom: 1.4em; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; }
.prose strong { color: var(--ink); }
.article-footer-nav { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }

/* ---------- Home news ---------- */

.news-section { background: #EBEBF0; }

.news-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: clip;
  color: inherit;
  transition: border-color var(--t-std) var(--ease), transform var(--t-std) var(--ease),
              box-shadow var(--t-std) var(--ease);
}
a.news-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(9, 18, 32, 0.1);
}
.news-thumb { aspect-ratio: 16 / 9; }
.news-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(1.3rem, 2.4vw, 1.8rem);
}
.news-body h3 { font-size: 1.2rem; margin-bottom: 1.2rem; }
.news-card .text-link { margin-top: auto; }
a.news-card:hover .text-link { color: var(--accent); }
a.news-card:hover .text-link::after { transform: translateX(4px); }

/* ---------- About ---------- */

.value-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.6rem, 3vw, 2.2rem); }
.value-panel .mono { color: var(--accent); display: block; margin-bottom: 1rem; }
.value-panel p { margin: 0; color: var(--ink-2); font-size: 1.02rem; line-height: 1.7; }

.person-card { display: flex; gap: 18px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; }
.person-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, var(--purple-soft), var(--electric-purple));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}
.person-card h3 { font-size: 1.1rem; margin: 0 0 0.2rem; }
.person-card p { margin: 0; font-size: 0.9rem; color: var(--ink-2); }

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

.contact-options { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.contact-options li { border-bottom: 1px solid var(--line-soft); padding: 1.1rem 2px; }
.contact-options .mono { color: var(--ink-3); display: block; margin-bottom: 0.3rem; }
.contact-options a, .contact-options strong { font-size: 1.05rem; font-weight: 500; color: var(--ink); }
.contact-options a:hover { color: var(--accent); }

.form-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.6rem, 3vw, 2.4rem); }
.form-panel label { display: block; margin-bottom: 1.1rem; }
.form-panel .mono { display: block; margin-bottom: 0.45rem; color: var(--ink-2); }
.form-panel input, .form-panel textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color var(--t-std) var(--ease);
}
.form-panel input:focus, .form-panel textarea:focus { border-color: var(--electric-purple); outline: none; }
.form-panel textarea { min-height: 130px; resize: vertical; }
.form-note { font-size: 0.82rem; color: var(--ink-3); margin: 0.9rem 0 0; }
.form-panel .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { font-size: 0.9rem; margin: 0.9rem 0 0; }
.form-status--pending { color: var(--ink-2); }
.form-status--ok { color: var(--ink-1); }
.form-status--error { color: #b33; }

.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 1.3rem 2px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--t-std) var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent);
  transition: transform var(--t-std) var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { margin: 0; padding: 0 2px 1.4rem; color: var(--ink-2); max-width: 62ch; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--deep-navy);
  color: var(--on-dark-2);
  padding: clamp(56px, 8vw, 90px) 0 34px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid rgba(193, 186, 218, 0.2);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand svg, .footer-brand img { height: 32px; width: auto; margin-bottom: 1.2rem; }
.footer-tagline { font-size: 0.9rem; color: var(--on-dark-2); max-width: 30ch; margin: 0; }

.footer-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(193, 186, 218, 0.6);
  margin: 0 0 1.1rem;
}
.footer-contact {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}
.footer-contact .footer-title { grid-area: 1 / 1; }
.footer-contact address { grid-area: 2 / 1; margin: 0; font-style: normal; font-size: 0.92rem; line-height: 1.7; }
.footer-contact-links { grid-area: 2 / 2; font-size: 0.92rem; line-height: 1.7; }
.footer-contact-links a { color: var(--on-dark-2); transition: color var(--t-std) var(--ease); }
.footer-contact-links a:hover { color: #fff; }

@media (max-width: 900px) {
  .footer-contact { grid-template-columns: 1fr; }
  .footer-contact .footer-title,
  .footer-contact address,
  .footer-contact-links { grid-area: auto; }
  .footer-contact-links { margin-top: 1rem; }
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
  padding-top: 28px;
  font-size: 0.8rem;
  color: rgba(193, 186, 218, 0.55);
}
.footer-bar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer-legal a { color: inherit; transition: color var(--t-micro) var(--ease); }
.footer-legal a:hover { color: var(--on-dark-2); }

/* ---------- CMS: post sections ----------
   Each section of an insight can carry a class that controls
   layout and colors. Presets selectable in the CMS editor. */

.post-section { padding-block: clamp(48px, 7vw, 88px); }
.post-section:first-of-type { padding-top: clamp(40px, 6vw, 72px); }
.article-foot { padding-bottom: clamp(56px, 8vw, 96px); }

/* rich markdown content */
.prose h3 { font-size: 1.2rem; margin-top: 1.9em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { color: var(--ink-2); line-height: 1.75; padding-left: 1.4em; margin-bottom: 1.4em; }
.prose li { margin-bottom: 0.4em; }
.prose img { border-radius: var(--radius-sm); margin: 1.8em 0; }
.prose video { border-radius: var(--radius-sm); margin: 1.8em 0; width: 100%; }
.prose blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.2em;
  border-left: 3px solid var(--accent);
  font-style: italic;
}
.prose blockquote p { margin-bottom: 0.6em; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(92, 55, 242, 0.08);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}
.prose pre {
  background: var(--deep-navy);
  color: var(--acid-lime-soft);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  overflow-x: auto;
  margin: 1.8em 0;
}
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* ps-dark: full-bleed navy band, light text */
.post-section.ps-dark, .section.ps-dark { background: var(--deep-navy); color: var(--on-dark); }
.ps-dark .prose p, .ps-dark .prose ul, .ps-dark .prose ol { color: var(--on-dark-2); }
.ps-dark .prose h1, .ps-dark .prose h2, .ps-dark .prose h3, .ps-dark .prose strong { color: #fff; }
.ps-dark .prose a { color: var(--signal); }
.ps-dark .prose code { background: rgba(255, 255, 255, 0.12); }

/* ps-tint: lavender band */
.post-section.ps-tint, .section.ps-tint { background: var(--lavender-grey); }

/* ps-lime: soft lime band */
.post-section.ps-lime, .section.ps-lime { background: var(--acid-lime-soft); }

/* ps-gradient: brand gradient band */
.post-section.ps-gradient, .section.ps-gradient { background: linear-gradient(140deg, var(--purple-soft), var(--electric-purple)); color: #fff; }
.ps-gradient .prose p, .ps-gradient .prose ul, .ps-gradient .prose ol { color: rgba(255, 255, 255, 0.88); }
.ps-gradient .prose h1, .ps-gradient .prose h2, .ps-gradient .prose h3, .ps-gradient .prose strong { color: #fff; }
.ps-gradient .prose a { color: var(--signal); }

/* ps-callout: boxed panel instead of plain text column */
/* The box itself is the visible element; the section's top padding only adds
   redundant whitespace after the preceding section (which has its own bottom
   padding). Bottom padding stays, for rhythm with what follows. */
.post-section.ps-callout { padding-top: 0; }
.ps-callout .prose {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.4rem);
}
.ps-callout .prose > :last-child { margin-bottom: 0; }

/* team avatar with photo */
.person-avatar--img { padding: 0; overflow: hidden; background: var(--lavender-grey); position: relative; }
.person-avatar--img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person-avatar--img > span { visibility: hidden; }

/* ---------- CMS: preview bar ---------- */

.preview-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 20px;
  background: var(--electric-purple);
  color: #fff;
  font-size: 0.82rem;
}
.preview-bar a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.preview-bar-actions { display: flex; gap: 18px; }
body.has-preview-bar .site-header { top: 37px; }
body.has-preview-bar { padding-top: 37px; }
body.has-preview-bar .scroll-story-pin { top: calc(var(--header-h) + 37px); }

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 550ms var(--ease), transform 550ms var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-animate-hero] > *, .reveal { opacity: 1; transform: none; }
}
