/* ==========================================================================
   Insight article: /insights/penguin-fm-ai-helpdesk-transformation
   Long-form article in the v2 design. Reuses article.css (art-p, art-h2,
   art-quote) and adds the article-only blocks with the `ia-` prefix (hero
   meta, press callout, hero chart, stats, notes, end CTA) plus the
   scroll-driven penguin reading-progress widget (`pw-`).
   Colours: --v2-* tokens, or the page tokens below (defined for both themes).
   ========================================================================== */
:root,
[data-theme="light"] {
  /* the walker is a small illustration: a penguin is black and white in either theme */
  --pf-penguin-ink: #1F2226;
  --pf-penguin-belly: #F3F1E8;
  --pf-penguin-beak: #F8B042;
}
[data-theme="dark"] {
  --pf-penguin-ink: #1F2226;
  --pf-penguin-belly: #F3F1E8;
  --pf-penguin-beak: #F8B042;
}

/* Hero ------------------------------------------------------------------- */
.ia-hero__inner {
  display: grid;
  gap: clamp(1.125rem, 0.9rem + 0.9vw, 1.625rem);   /* 18 → 26 */
  justify-items: start;
}
.ia-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--v2-fs-small);
  font-weight: 600;
  color: var(--v2-text-muted);
  text-decoration: none;
  transition: color var(--v2-dur) ease;
}
.ia-back:hover { color: var(--v2-accent-ink); }
.ia-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ia-pill {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--v2-r-pill);
  border: 1px solid var(--v2-chip-border);
  font-size: var(--v2-fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--v2-text-muted);
}
.ia-pill--primary {
  border-color: var(--v2-accent-tint-border);
  background: var(--v2-accent-tint);
  color: var(--v2-accent-ink);
}
.ia-title {
  max-width: 1000px;
  font-size: clamp(2rem, 1.5rem + 2.1vw, 3.5rem);   /* 32 → 56: long headline */
  line-height: 1.1;
  text-wrap: balance;
}
.ia-deck { max-width: 820px; }

/* "As featured in" press callout */
.ia-feature {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 820px;
  padding: 18px 22px;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-banner);
  background: var(--v2-card-bg);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--v2-dur) ease, background-color var(--v2-dur) ease, transform var(--v2-dur) ease;
}
.ia-feature:hover {
  border-color: var(--v2-accent-tint-border);
  background: var(--v2-card-bg-hover);
  transform: translateY(-2px);
}
.ia-feature__text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.ia-feature__eyebrow {
  font-size: var(--v2-fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--v2-ls-eyebrow);
  text-transform: uppercase;
  color: var(--v2-accent-ink);
}
.ia-feature__name {
  font-family: var(--v2-font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--v2-text);
}
.ia-feature__blurb { font-size: var(--v2-fs-small); line-height: 1.55; color: var(--v2-text-muted); }
.ia-feature__cta {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: var(--v2-fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--v2-accent-ink);
}
@media (max-width: 599px) {
  .ia-feature { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* Byline / meta strip */
.ia-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: var(--v2-fs-small);
  color: var(--v2-text-muted);
}
.ia-meta strong { font-weight: 600; color: var(--v2-text); }
.ia-meta a { color: var(--v2-accent-ink); text-decoration: none; }
.ia-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ia-meta__dot { opacity: 0.6; }

/* Body column ---------------------------------------------------------- */
.ia-section { padding-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.ia-body { display: grid; gap: clamp(2rem, 1.6rem + 1.6vw, 3.25rem); }
.ia-prose { display: grid; gap: 20px; align-content: start; min-width: 0; }
.ia-prose .art-p strong { color: var(--v2-text); font-weight: 600; }
.ia-h2 {
  margin-top: clamp(1.25rem, 1rem + 1vw, 2rem);
  font-size: clamp(1.625rem, 1.4rem + 0.95vw, 2.375rem);   /* 26 → 38 */
  line-height: 1.15;
}

/* Hero chart (inline SVG, colours from tokens) */
.ia-hero-art {
  padding: clamp(14px, 1rem + 1.4vw, 36px);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-card);
  background: var(--v2-surface);
  box-shadow: var(--v2-shadow-frame);
}
.ia-hero-art svg { display: block; width: 100%; height: auto; max-height: 320px; }
.ia-c-accent { fill: var(--v2-accent-ink); }
.ia-c-text { fill: var(--v2-text); }
.ia-c-muted { fill: var(--v2-text-muted); }
.ia-c-faint { fill: var(--v2-text-muted); opacity: 0.8; }
.ia-c-line { stroke: var(--v2-line-soft); fill: none; }
.ia-c-bar { fill: var(--v2-line-soft); }
.ia-c-stop { stop-color: var(--v2-accent); }

/* Pull quotes (art-quote from article.css adds the accent rule) */
.ia-quote { margin-block: 12px; }
.ia-quote__text {
  font-family: var(--v2-font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);   /* 20 → 26 */
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--v2-text);
}

/* Stats */
.ia-stat {
  display: grid;
  gap: 10px;
  align-content: start;
  margin-block: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--v2-line);
}
.ia-stat__num {
  font-family: var(--v2-font-display);
  font-weight: 500;
  font-size: var(--v2-fs-statnum);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--v2-accent-ink);
}
.ia-stat__lbl { max-width: 680px; font-size: var(--v2-fs-ui); line-height: 1.55; color: var(--v2-text-muted); }
.ia-stat__lbl strong { color: var(--v2-text); font-weight: 600; }
.ia-stat-row {
  display: grid;
  gap: var(--v2-stack);
  grid-template-columns: 1fr;
  margin-block: 12px;
}
.ia-stat-row .ia-stat { margin-block: 0; }
@media (min-width: 700px) { .ia-stat-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Divider, notes to editors, end CTA */
.ia-divider { margin-block: 20px; }
.ia-notes {
  display: grid;
  gap: 10px;
  max-width: 760px;
  font-size: var(--v2-fs-small);
  line-height: 1.6;
  color: var(--v2-text-muted);
}
.ia-notes__eyebrow { margin-bottom: 4px; font-weight: 600; }
.ia-notes strong { color: var(--v2-text); font-weight: 600; }
.ia-notes a { color: var(--v2-accent-ink); text-underline-offset: 3px; }
.ia-end-cta {
  display: grid;
  gap: 18px;
  justify-items: start;
  margin-top: 28px;
  padding: clamp(28px, 1.2rem + 2.4vw, 48px);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-panel);
  background: var(--v2-banner-bg);
}
.ia-end-cta__title { margin: 0; }
.ia-end-cta__sub { max-width: 640px; }

/* ───────── Scroll-driven walker (small SVG penguin → TYTEN logo) ───────── */
.penguin-walker {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 40; pointer-events: none;
  width: clamp(320px, 55vw, 480px);
  background: var(--v2-glass-bg);
  border: 1px solid var(--v2-glass-border);
  border-radius: 14px;
  padding: 12px 18px 10px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--v2-shadow-panel);
  opacity: 0; transition: opacity .3s ease;
}
.penguin-walker.is-ready { opacity: 1; }
.pw-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--v2-font-display);
  font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--v2-text-muted); margin-bottom: 6px;
}
.pw-meta-pct { color: var(--v2-accent-ink); }
.pw-stage { position: relative; height: 50px; }
.pw-track {
  position: absolute; left: 38px; right: 78px; bottom: 4px; height: 1px;
  background-image: linear-gradient(90deg, var(--v2-accent-tint-border) 50%, transparent 50%);
  background-size: 8px 1px; background-repeat: repeat-x;
}
.pw-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--v2-line-soft) 12%, var(--v2-line-soft) 88%, transparent 100%);
}
.pw-pen {
  position: absolute; bottom: 2px; left: 0;
  width: 30px; height: 38px;
  will-change: transform;
  transition: transform 80ms linear;
}
.pw-pen svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* night: thin light rim so the black penguin reads on the dark glass panel */
[data-theme="dark"] .pw-pen svg { filter: drop-shadow(0 0 1px var(--v2-line-strong)); }
.pw-ink { fill: var(--pf-penguin-ink); }
.pw-belly { fill: var(--pf-penguin-belly); }
.pw-beak { fill: var(--pf-penguin-beak); }
/* CSS-driven foot bob — no need for JS frame swapping */
.penguin-walker.is-walking .pw-foot-l { animation: pwFootL .42s ease-in-out infinite; transform-origin: center; }
.penguin-walker.is-walking .pw-foot-r { animation: pwFootR .42s ease-in-out infinite; transform-origin: center; }
@keyframes pwFootL { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes pwFootR { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(0); } }
.pw-target {
  position: absolute; bottom: 2px; right: 6px;
  display: flex; align-items: center; justify-content: center;
  height: 38px;
}
.pw-target .v2-logo__word { width: auto; height: 14px; opacity: .85; }
.penguin-walker.is-arrived .pw-target .v2-logo__word { animation: pwPulse 1.4s ease-in-out infinite; opacity: 1; }
@keyframes pwPulse {
  0%, 100% { filter: drop-shadow(0 0 0 transparent); }
  50% { filter: drop-shadow(0 0 6px var(--v2-accent)); }
}
@media (prefers-reduced-motion: reduce) {
  .pw-pen { transition: none; }
  .penguin-walker.is-walking .pw-foot-l,
  .penguin-walker.is-walking .pw-foot-r { animation: none; }
  .penguin-walker.is-arrived .pw-target .v2-logo__word { animation: none; }
}
@media (max-width: 640px) {
  .penguin-walker { display: none; }
}
