/* ==========================================================================
   Accelerating AI - Interactive White Paper
   Loaded only on the "White Paper" page template. Builds on the Signal design
   tokens (signal.css) and adds the long-form "document" reading experience:
   a dark cover, white reading pages, animated charts, data tables and a dark
   close, plus a reading-progress bar and a Download-PDF / Share action bar.
   ========================================================================== */

/* Local light-theme tokens for the white "paper" body (Signal is dark). */
.aai-wp {
  --wp-paper: #ffffff;
  --wp-paper-2: #f6f7f9;
  --wp-ink: #17181b;
  --wp-body: #3c4046;
  --wp-muted: #6b7177;
  --wp-line: #e7e9ee;
  --wp-line-strong: #d4d8df;
  --wp-accent: var(--accent, #0082ff);
  --wp-accent-soft: rgba(0, 130, 255, .10);
  --wp-maxw: 760px;            /* reading measure */
  --wp-docw: 1080px;           /* paper width */
}

/* The page builder sits on the dark stage; the doc floats on it. */
.aai-wp { background: var(--surface-page, #191919); }

/* ----------------------------------------------------------------------------
   Reading-progress bar (fixed, top of viewport)
   ------------------------------------------------------------------------- */
.wp-progress {
  position: fixed; inset: 0 auto auto 0; width: 100%; height: 3px; z-index: 60;
  background: transparent; pointer-events: none;
}
.wp-progress__bar {
  height: 100%; width: 0; transform-origin: left center;
  background: linear-gradient(90deg, var(--wp-accent), #2e90fa);
  box-shadow: 0 0 12px -2px var(--wp-accent);
  transition: width .12s linear;
}

/* ----------------------------------------------------------------------------
   Cover (dark) - the document "front page"
   ------------------------------------------------------------------------- */
.wp-cover { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 96px) 0 clamp(48px, 8vw, 104px); }
.wp-cover__glow {
  position: absolute; left: 50%; top: -10%; width: min(1100px, 120%); height: 720px;
  transform: translateX(-50%); pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, rgba(0,130,255,.30), rgba(0,130,255,0) 70%);
}
.wp-cover__in { position: relative; z-index: 1; }
.wp-cover__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: clamp(40px, 7vw, 88px); }
.wp-cover__brand { display: inline-flex; align-items: center; gap: 12px; }
.wp-cover__brand img, .wp-cover__brand svg { height: 34px; width: auto; }
.wp-cover__tag {
  font-size: 12px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: var(--text-secondary, #aaa);
}
.wp-cover__badge { margin-bottom: 26px; height: auto; white-space: normal; line-height: 1.35; padding-top: 7px; padding-bottom: 7px; text-align: left; }
.wp-cover__badge svg { flex: 0 0 auto; }
.wp-cover h1 {
  font-size: clamp(42px, 7vw, 88px); line-height: .98; letter-spacing: -.035em;
  max-width: 14ch; margin: 0;
}
.wp-cover__stand {
  margin-top: 22px; max-width: 30ch; color: var(--text-secondary, #aaa);
  font-size: clamp(18px, 2.2vw, 24px); line-height: 1.5;
}
.wp-cover__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-top: clamp(40px, 6vw, 72px);
}
.wp-stat {
  background: var(--surface-card, #1c1c1c); border-radius: var(--radius-md, 12px);
  padding: 22px 22px 20px; box-shadow: var(--stroke-card, inset 0 0 0 1px #2a2a2a);
}
.wp-stat--accent { box-shadow: inset 0 0 0 1px var(--wp-accent); background: linear-gradient(180deg, rgba(0,130,255,.08), rgba(0,130,255,0)); }
.wp-stat__n { font-size: clamp(30px, 4vw, 44px); font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.wp-stat--accent .wp-stat__n { color: var(--wp-accent); }
.wp-stat__l { margin-top: 12px; color: var(--text-secondary, #aaa); font-size: 14px; line-height: 1.45; }
.wp-cover__foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin-top: clamp(40px, 6vw, 72px); padding-top: 22px; border-top: 1px solid var(--border-default, #2a2a2a);
  color: var(--text-muted, #666); font-size: 13.5px; line-height: 1.5;
}
.wp-cover__foot b { color: var(--text-secondary, #aaa); font-weight: 500; white-space: nowrap; }

/* ----------------------------------------------------------------------------
   The white "paper" document
   ------------------------------------------------------------------------- */
.wp-doc {
  max-width: var(--wp-docw); margin: 0 auto; background: var(--wp-paper); color: var(--wp-body);
  border-radius: clamp(14px, 2vw, 26px) clamp(14px, 2vw, 26px) 0 0;
  padding: clamp(40px, 6vw, 88px) clamp(22px, 5vw, 96px) clamp(56px, 8vw, 104px);
  box-shadow: 0 -10px 60px -20px rgba(0,0,0,.6);
}
.wp-doc__inner { max-width: 900px; margin: 0 auto; }

/* Contents */
.wp-toc__h, .wp-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--wp-accent);
}
.wp-toc { margin-top: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.wp-toc a {
  display: grid; grid-template-columns: 2.2em 1fr; align-items: baseline; gap: 6px;
  padding: 13px 0; border-bottom: 1px solid var(--wp-line); color: var(--wp-ink);
  font-size: 15.5px; transition: color .15s ease;
}
.wp-toc a:hover { color: var(--wp-accent); }
.wp-toc__no { color: var(--wp-accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.wp-doc__rule { height: 2px; background: var(--wp-ink); margin: clamp(34px,5vw,56px) 0; opacity: .9; }

/* Sections */
.wp-sec { padding-top: clamp(40px, 6vw, 72px); scroll-margin-top: 90px; }
.wp-sec:first-of-type { padding-top: 0; }
.wp-sec__no { display: inline-block; font-size: 14px; font-weight: 700; color: var(--wp-accent); letter-spacing: .06em; }
.wp-sec > h2 {
  color: var(--wp-ink); font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.025em; line-height: 1.06;
  margin: 8px 0 0;
}
.wp-sec h3 {
  color: var(--wp-ink); font-size: clamp(19px, 2vw, 23px); letter-spacing: -.01em; line-height: 1.25;
  margin: clamp(28px,4vw,40px) 0 0;
}
.wp-sec h4 { color: var(--wp-ink); font-size: 17px; margin: 26px 0 0; }

/* Prose */
.wp-prose { max-width: var(--wp-maxw); }
.wp-prose p { margin-top: 16px; font-size: 17px; line-height: 1.72; color: var(--wp-body); }
.wp-prose p:first-child { margin-top: 18px; }
.wp-lede p:first-of-type { font-size: 19px; color: #2c2f34; }
.wp-prose a { color: var(--wp-accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.wp-prose strong { color: var(--wp-ink); font-weight: 600; }
.wp-ref { font-size: .72em; font-weight: 700; color: var(--wp-accent); vertical-align: super; line-height: 0; padding-left: 2px; text-decoration: none; }
/* Lists / quotes authored directly inside a prose block (the editor's own
   bullet, number and quote buttons) still read correctly without a class. */
.wp-prose ul, .wp-prose ol { margin: 16px 0 0; padding-left: 24px; }
.wp-prose ul li, .wp-prose ol li { margin-top: 8px; font-size: 17px; line-height: 1.65; color: var(--wp-body); }
.wp-prose ul { list-style: disc; }
.wp-prose ol { list-style: decimal; }
.wp-prose blockquote {
  max-width: var(--wp-maxw); margin: clamp(28px,4vw,40px) 0 0; padding: 4px 0 4px 26px;
  border-left: 3px solid var(--wp-accent); font-size: clamp(20px, 2.4vw, 26px); line-height: 1.34;
  letter-spacing: -.015em; color: var(--wp-ink); font-weight: 500;
}
.wp-prose h4 { color: var(--wp-ink); font-size: 17px; margin: 26px 0 0; }

/* Key-findings / generic check list */
.wp-list { max-width: var(--wp-maxw); margin-top: 22px; list-style: none; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.wp-list li {
  position: relative; padding: 16px 18px 16px 48px; background: var(--wp-paper-2);
  border: 1px solid var(--wp-line); border-radius: var(--radius-sm, 8px);
  font-size: 16px; line-height: 1.6; overflow-wrap: anywhere;
}
.wp-list li::before {
  content: ""; position: absolute; left: 18px; top: 21px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--wp-accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--wp-accent);
}
.wp-list li strong { color: var(--wp-ink); }

/* Sources: numbered [n], no ring bullet, and long URLs must wrap */
.wp-sources { counter-reset: none; }
.wp-sources li { padding-left: 18px; }
.wp-sources li::before { display: none; }
.wp-sources a { color: var(--wp-accent); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; word-break: break-word; }

/* Pull quote */
.wp-quote {
  max-width: var(--wp-maxw); margin: clamp(28px,4vw,40px) 0 0; padding: 4px 0 4px 26px;
  border-left: 3px solid var(--wp-accent);
  font-size: clamp(22px, 2.8vw, 30px); line-height: 1.32; letter-spacing: -.015em;
  color: var(--wp-ink); font-weight: 500;
}
.wp-quote cite { display: block; margin-top: 14px; font-size: 15px; font-style: normal; font-weight: 600; color: var(--wp-muted); }

/* Inline stat group (within the white doc) */
.wp-figerow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px; max-width: var(--wp-maxw); }
.wp-figerow .wp-mini { background: var(--wp-paper-2); border: 1px solid var(--wp-line); border-radius: 10px; padding: 18px; }
.wp-mini__n { font-size: 30px; font-weight: 700; color: var(--wp-ink); letter-spacing: -.02em; line-height: 1; }
.wp-mini__n .u { color: var(--wp-accent); }
.wp-mini__l { margin-top: 8px; font-size: 13px; color: var(--wp-muted); line-height: 1.4; }

/* ----------------------------------------------------------------------------
   Bar charts (animated on scroll)
   ------------------------------------------------------------------------- */
.wp-figure { margin: clamp(26px,4vw,38px) 0 0; max-width: var(--wp-maxw); }
.wp-chart {
  background: var(--wp-paper-2); border: 1px solid var(--wp-line); border-radius: 14px;
  padding: clamp(18px, 3vw, 26px);
}
.wp-chart__title { font-size: 15px; font-weight: 600; color: var(--wp-ink); margin-bottom: 18px; }
.wp-bar { display: grid; grid-template-columns: minmax(110px, 32%) 1fr auto; gap: 12px; align-items: center; margin-top: 12px; }
.wp-bar:first-of-type { margin-top: 0; }
.wp-bar__label { font-size: 13.5px; color: var(--wp-body); }
.wp-bar__track { position: relative; height: 26px; background: #eceef2; border-radius: 6px; overflow: hidden; }
.wp-bar__fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--wp-accent), #3a9bff);
  transition: width 1.1s cubic-bezier(.16,1,.3,1);
}
.wp-bar--lead .wp-bar__fill { background: linear-gradient(90deg, #16324a, #1f4e74); }
.wp-bar__val {
  min-width: 46px; text-align: right; font-size: 13px; font-weight: 700;
  color: var(--wp-ink); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .4s ease .4s;
}
.wp-bar.is-in .wp-bar__val { opacity: 1; }
.wp-fig__cap { margin-top: 14px; font-size: 13px; color: var(--wp-muted); line-height: 1.5; }
.wp-fig__cap b { color: var(--wp-body); font-weight: 600; }

/* ----------------------------------------------------------------------------
   Data tables (scroll on small screens)
   ------------------------------------------------------------------------- */
.wp-tablebox { position: relative; margin-top: 22px; }
.wp-tablewrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--wp-line); border-radius: 12px; }
/* Swipe hint: fade the right edge on narrow screens where the table scrolls. */
.wp-tablebox::after { content: ""; position: absolute; top: 1px; right: 1px; bottom: 1px; width: 30px; pointer-events: none;
  border-radius: 0 12px 12px 0; background: linear-gradient(90deg, rgba(255,255,255,0), var(--wp-paper)); opacity: 0; transition: opacity .2s ease; }
@media (max-width: 720px) { .wp-tablebox::after { opacity: 1; } }
.wp-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 540px; }
.wp-table th, .wp-table td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--wp-line); vertical-align: top; line-height: 1.5; }
.wp-table thead th {
  background: var(--wp-paper-2); color: var(--wp-ink); font-weight: 700; font-size: 11.5px;
  letter-spacing: .08em; text-transform: uppercase; position: sticky; top: 0;
}
.wp-table tbody tr:last-child td { border-bottom: 0; }
.wp-table tbody tr:nth-child(even) td { background: #fafbfc; }
.wp-table td:first-child { color: var(--wp-ink); font-weight: 600; }
.wp-table--score td:not(:first-child) { color: var(--wp-muted); }

/* Speaker insight block */
.wp-speaker { max-width: var(--wp-maxw); margin-top: clamp(26px,4vw,38px); padding-top: clamp(26px,4vw,38px); border-top: 1px solid var(--wp-line); }
.wp-speaker:first-of-type { border-top: 0; }
.wp-speaker__no { font-size: 13px; font-weight: 700; color: var(--wp-accent); font-variant-numeric: tabular-nums; }
.wp-speaker h3 { margin-top: 4px; }
.wp-speaker__role { margin-top: 4px; font-size: 13.5px; color: var(--wp-muted); }

/* Dark feature card embedded in the white doc (e.g. partners strip) */
.wp-feature {
  margin: clamp(28px,4vw,40px) 0 0; background: var(--surface-section, #161616); color: #fff;
  border-radius: 16px; padding: clamp(24px, 4vw, 40px);
}
.wp-feature__h { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--wp-accent); }
.wp-logos { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 24px 20px; align-items: center; }
.wp-logos img { height: 30px; width: auto; max-width: 100%; object-fit: contain; opacity: .92; }

/* 90-day plan period chips inside the table */
.wp-table .wp-period { color: var(--wp-accent); font-weight: 700; white-space: nowrap; }

/* ----------------------------------------------------------------------------
   Close (dark) - connect, partners, CTA
   ------------------------------------------------------------------------- */
.wp-close { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 72px); }
.wp-close__glow {
  position: absolute; right: -10%; bottom: -20%; width: 760px; height: 760px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0,130,255,.18), rgba(0,130,255,0) 70%);
}
.wp-cta {
  position: relative; z-index: 1; background: linear-gradient(135deg, #0b2742, #0a1722);
  border-radius: 24px; box-shadow: inset 0 0 0 1px rgba(0,130,255,.28);
  padding: clamp(36px, 5vw, 64px); overflow: hidden;
}
.wp-cta h2 { font-size: clamp(28px, 4vw, 46px); letter-spacing: -.025em; line-height: 1.04; max-width: 18ch; }
.wp-cta p { margin-top: 16px; max-width: 56ch; color: var(--text-secondary, #cfd3d8); font-size: 18px; line-height: 1.55; }
.wp-cta__btns { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px; }

.wp-connect { position: relative; z-index: 1; display: grid; grid-template-columns: 1.4fr .9fr; gap: clamp(28px,4vw,56px); align-items: center; margin-top: clamp(40px,6vw,72px); }
.wp-connect__list { display: grid; gap: 18px; }
.wp-conn { display: flex; align-items: center; gap: 14px; }
.wp-conn__t b { display: block; color: #fff; font-weight: 600; font-size: 16px; }
.wp-conn__t span { color: var(--text-muted, #888); font-size: 14px; }
.wp-qr { justify-self: end; background: #fff; border-radius: 18px; padding: 18px; text-align: center; max-width: 220px; }
.wp-qr img, .wp-qr svg { width: 150px; height: 150px; display: block; margin: 0 auto; }
.wp-qr span { display: block; margin-top: 10px; font-size: 12.5px; color: #444; line-height: 1.35; }

.wp-partners { position: relative; z-index: 1; margin-top: clamp(40px,6vw,72px); padding-top: clamp(32px,5vw,48px); border-top: 1px solid var(--border-default, #2a2a2a); }
.wp-partners__h { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--wp-accent); }
.wp-partners__grid { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 30px 24px; align-items: center; justify-items: center; }
.wp-partners__grid img { height: 34px; width: auto; max-width: 100%; object-fit: contain; opacity: .9; }
.wp-close__note { margin-top: clamp(28px,4vw,40px); color: var(--text-muted, #777); font-size: 13.5px; line-height: 1.6; max-width: 70ch; }

/* ----------------------------------------------------------------------------
   Floating action bar - Download PDF + Share
   ------------------------------------------------------------------------- */
.wp-actions {
  position: fixed; right: clamp(16px, 3vw, 32px); bottom: clamp(16px, 3vw, 28px); z-index: 55;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.wp-actions__btn {
  display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 20px;
  border: 0; cursor: pointer; border-radius: var(--radius-pill, 100px); font-family: var(--font-sans, sans-serif);
  font-size: 15px; font-weight: 600; white-space: nowrap; text-decoration: none;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.6); transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.wp-actions__btn svg { width: 18px; height: 18px; }
.wp-actions__btn:active { transform: scale(.97); }
.wp-actions__btn--pdf { background: var(--wp-accent); color: #fff; }
.wp-actions__btn--pdf:hover { background: var(--accent-hover, #2e90fa); color: #fff; box-shadow: 0 0 0 1px var(--accent-hover,#2e90fa), 0 10px 34px -8px rgba(0,130,255,.55); }
.wp-actions__btn--share { background: #fff; color: #17181b; }
.wp-actions__btn--share:hover { background: #eef1f4; color: #17181b; }
.wp-actions__btn[hidden] { display: none; }

/* Copied-to-clipboard toast */
.wp-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px); z-index: 70;
  background: #17181b; color: #fff; border: 1px solid rgba(255,255,255,.14);
  padding: 11px 18px; border-radius: var(--radius-pill, 100px); font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.wp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ----------------------------------------------------------------------------
   Reveal-on-scroll (scoped; mirrors the Signal [data-rs] pattern)
   ------------------------------------------------------------------------- */
.js .aai-wp [data-wp] { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease-out, cubic-bezier(.16,1,.3,1)), transform .7s var(--ease-out, cubic-bezier(.16,1,.3,1)); }
.js .aai-wp [data-wp].in { opacity: 1; transform: none; }

/* ----------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .wp-connect { grid-template-columns: 1fr; }
  .wp-qr { justify-self: start; }
}
@media (max-width: 700px) {
  .wp-cover__stats { grid-template-columns: 1fr; }
  .wp-toc { grid-template-columns: 1fr; gap: 0; }
  .wp-figerow { grid-template-columns: 1fr; }
  .wp-cover__top { flex-wrap: wrap; }
  .wp-cover__foot { flex-direction: column; align-items: flex-start; gap: 10px; }
  .wp-bar { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .wp-bar__label { grid-column: 1 / -1; }
  .wp-bar__track { height: 24px; }
  .wp-actions__btn span { display: none; }     /* icon-only buttons on phones */
  .wp-actions__btn { height: 52px; width: 52px; justify-content: center; padding: 0; }
}

/* ----------------------------------------------------------------------------
   Motion & print
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .js .aai-wp [data-wp] { opacity: 1; transform: none; transition: none; }
  .wp-bar__fill { transition: none; }
  .wp-bar__val { transition: none; }
  .wp-progress__bar { transition: none; }
}
@media print {
  .wp-progress, .wp-actions, .wp-close__glow, .wp-cover__glow { display: none !important; }
  .aai-wp { background: #fff; }
  .wp-doc { box-shadow: none; max-width: none; }
  .wp-bar__fill { transition: none; }
}
