/* Live experiments: the "Live" badge on the start page and the page experimente.html.
   Everything for this feature lives in this one file, tokens first, so a new design
   (Falco may send inspiration) is a change here only. Builds on v3.css tokens. */

:root {
  --xp-live: #16A34A;        /* status: läuft / running */
  --xp-paused: #E8900C;      /* status: pausiert / paused */
  --xp-done: #8A8296;        /* status: abgeschlossen / finished */
  --xp-win: #16A34A;         /* better value in a comparison */
  --xp-chip-bg: var(--surface-tint, #F4EEE5);
  --xp-honest-bar: var(--orange, #FFAA32);
  --xp-radius: var(--tile-radius, 28px);
}

/* ---------- Status dot (shared) ---------- */
.xp-dot { position: relative; display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--xp-live); }
.xp-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; }
.xp-status.is-live .xp-dot { background: var(--xp-live); }
.xp-status.is-paused .xp-dot { background: var(--xp-paused); }
.xp-status.is-done .xp-dot { background: var(--xp-done); }

/* Pulse only for "live" dots; off for reduced motion */
.xp-pulse::after, .xp-status.is-live .xp-dot::after, .xp-intro .v3-kicker .xp-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--xp-live); opacity: 0;
  animation: xp-pulse 2s cubic-bezier(0.23, 1, 0.32, 1) infinite;
}
@keyframes xp-pulse { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .xp-pulse::after, .xp-status.is-live .xp-dot::after, .xp-intro .v3-kicker .xp-dot::after { animation: none; opacity: 0; }
}

/* ---------- Start page badge ---------- */
.xp-live {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 16px 10px 14px;
  border-radius: 999px; background: var(--surface); box-shadow: var(--tile-shadow);
  font-size: .9375rem; font-weight: 650; color: var(--ink); text-decoration: none;
  transition: transform 160ms ease-out, box-shadow 160ms ease-out;
}
.xp-live:hover { box-shadow: var(--tile-shadow-hover); }
.xp-live:active { transform: scale(.97); }
.xp-live:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.xp-live .xp-arrow { color: var(--violet); }

/* ---------- Page ---------- */
.xp-intro { max-width: 760px; margin: 0 auto 36px; }
.xp-intro .v3-kicker { display: inline-flex; align-items: center; gap: 10px; }
.xp-intro .v3-kicker .xp-dot { width: 10px; height: 10px; }
.xp-intro h1 { margin: 0 0 14px; font-size: clamp(2.1rem, 8vw, 3.5rem); line-height: 1.05; }
.xp-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 22px 0 0; padding: 0; list-style: none; font-size: .875rem; color: var(--muted); }
.xp-legend .xp-status { font-weight: 550; }
.xp-updated { margin: 10px 0 0; font-size: .8125rem; color: var(--muted); }

.xp-list { display: grid; gap: 24px; max-width: 1040px; margin: 0 auto; padding: 0; list-style: none; }
.xp-entry { padding: 24px 20px; border-radius: var(--xp-radius); }
.xp-entry h2 { margin: 6px 0 18px; font-size: clamp(1.5rem, 5.4vw, 2.125rem); line-height: 1.12; }
.xp-entry h3 { margin: 18px 0 4px; font-family: inherit; font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.xp-entry h3:first-child { margin-top: 0; }
.xp-entry p { margin: 0 0 10px; max-width: 62ch; text-wrap: pretty; }

.xp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; font-size: .875rem; color: var(--text); }
.xp-meta time { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.xp-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--xp-chip-bg); font-size: .8125rem; font-weight: 600; color: var(--text); }

.xp-grid { display: grid; gap: 22px; }
.xp-data { display: flex; flex-direction: column; gap: 12px; }
.xp-lead { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.xp-lead b { font-family: var(--serif); font-size: clamp(2.5rem, 9vw, 3.25rem); line-height: 1; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.xp-lead > span { font-size: .9375rem; color: var(--text); }

.xp-table { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.xp-table th, .xp-table td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.xp-table thead th { padding-top: 0; font-size: .8125rem; font-weight: 650; color: var(--muted); }
.xp-table tbody th { text-align: left; font-weight: 550; color: var(--text); white-space: normal; }
.xp-table th:first-child { padding-left: 0; }
.xp-table td:last-child, .xp-table th:last-child { padding-right: 0; }
.xp-table .is-win { color: var(--xp-win); font-weight: 700; }
.xp-table .xp-delta { font-weight: 700; color: var(--ink); }
.xp-table .xp-delta.is-flat { color: var(--muted); }

.xp-fine { font-size: .8125rem; color: var(--muted); }
.xp-entry .xp-fine { margin: 0; }
.xp-honest { padding: 12px 14px; border-left: 3px solid var(--xp-honest-bar); border-radius: 4px 14px 14px 4px; background: var(--xp-chip-bg); }
.xp-honest p { margin: 0; font-size: .9375rem; }
.xp-more { align-self: flex-start; padding: 8px 0; font-weight: 650; color: var(--ink); text-underline-offset: 4px; }

@media (min-width: 900px) {
  .xp-entry { padding: 36px 40px; }
  .xp-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .xp-entry-compact .xp-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}

/* ---------- Entry (a): same paywall, different words ----------
   Illustrated paywall screens in the client app's design system:
   near-black canvas, one card step, pastel sky-blue CTA, lime PRO gradient.
   Screens scale with their own width (container query units). */
:root {
  --ia-canvas: #0B0B0B;
  --ia-card: #151517;
  --ia-hairline: #27272A;
  --ia-ink: #FFFFFF;
  --ia-ink-2: #8C8C8C;
  --ia-cta: #8AD6FC;
  --ia-pro-1: #E2ED81;
  --ia-pro-2: #EFDF7F;
}
.xp-wd-title { display: flex; flex-direction: column; gap: 4px; }
.xp-wd-kpi { font-size: clamp(2.6rem, 10vw, 4rem); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.xp-wd-aha { margin: 0 0 22px !important; font-size: clamp(1.0625rem, 3.6vw, 1.25rem); font-weight: 600; color: var(--ink); }

.xp-ba { display: grid; gap: 18px; }
.xp-ba-col { margin: 0; padding: 16px; border-radius: 22px; background: var(--surface-tint); }
.xp-ba-col.is-after { background: #EAF6FD; box-shadow: inset 0 0 0 2px var(--ia-cta); }
.xp-ba-col figcaption { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: .9375rem; font-weight: 650; color: var(--ink); }
.xp-ba-tag { padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; background: var(--surface); color: var(--muted); }
.is-after .xp-ba-tag { background: var(--ia-cta); color: var(--ia-canvas); }
.xp-phones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* iPhone frame (CSS only): titanium rim, side buttons, Dynamic Island over a rendered screen.
   The screens are images (assets/experiments/paywall-*.webp): the graph paywall from the app's Figma handoff (393 x 852 pt, Nunito) with the test copy.
   All frame sizes are in cqw of .xp-dev, so the phone scales as one piece. */
.xp-dev { container-type: inline-size; min-width: 0; padding: 0 3%; }
.xp-iphone { position: relative; aspect-ratio: 100 / 209.4; padding: 3.4cqw; border-radius: 16cqw; background: #050506;
  box-shadow: 0 0 0 .7cqw #2C2C30, 0 0 0 1.25cqw #9A9AA0, 0 0 0 1.6cqw #3B3B40, 0 24px 40px -18px rgba(11, 11, 11, .55), 0 6px 14px -6px rgba(11, 11, 11, .35); }
.xp-iphone::before, .xp-iphone::after { content: ""; position: absolute; width: 1.4cqw; background: #7E7E85; }
.xp-iphone::before { left: -2.9cqw; top: 15%; height: 30%; border-radius: 1cqw 0 0 1cqw;
  background: linear-gradient(#7E7E85 0 11%, transparent 11% 27%, #7E7E85 27% 58%, transparent 58% 69%, #7E7E85 69% 100%); }
.xp-iphone::after { right: -2.9cqw; top: 26%; height: 14%; border-radius: 0 1cqw 1cqw 0; }
.xp-scr { height: 100%; border-radius: 12.6cqw; overflow: hidden; background: #000; }
.xp-scr img { display: block; width: 100%; height: 100%; object-fit: cover; }
.xp-island { position: absolute; top: 5.6cqw; left: 50%; width: 29cqw; height: 8.4cqw; border-radius: 99px; background: #000; transform: translateX(-50%); }

/* Phones: swipe through the two screens on narrow screens so the text stays readable */
@media (max-width: 559px) {
  .xp-phones { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 68%; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 4px 2px 10px; margin: 0 -2px; scrollbar-width: none; }
  .xp-phones::-webkit-scrollbar { display: none; }
  .xp-dev { scroll-snap-align: start; }
}

.xp-wd-source { margin: 14px 0 0 !important; font-size: .9375rem; color: var(--text); }

.xp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0 10px; padding: 0; list-style: none; }
.xp-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; border-radius: 18px; background: var(--surface-tint); }
.xp-stat-label { font-size: .8125rem; font-weight: 650; color: var(--muted); }
.xp-stat-vals { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-variant-numeric: tabular-nums; }
.xp-stat-before { font-size: .9375rem; color: var(--muted); }
.xp-stat-arrow { color: var(--muted); }
.xp-stat-vals b { font-family: var(--serif); font-size: clamp(1.25rem, 4.6vw, 1.75rem); font-weight: 600; color: var(--ink); }
.xp-stat-delta { align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: rgba(22, 163, 74, .12); color: var(--xp-win); font-size: .8125rem; font-weight: 750; font-variant-numeric: tabular-nums; }

@media (max-width: 520px) {
  .xp-stats { grid-template-columns: 1fr; }
  .xp-stat { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
  .xp-stat-label { flex-basis: 100%; }
}
@media (min-width: 760px) {
  .xp-ba { grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* ---------- Entries (b)-(d): same compact pattern as (a) ---------- */
.xp-stat-note { font-size: .8125rem; color: var(--text); text-wrap: pretty; }
.xp-stats-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xp-entry .xp-wd-source + .xp-fine { margin-top: 10px; }
.xp-entry > article > .xp-more { display: inline-block; margin-top: 6px; }

/* (b) Bar chart: baseline vs Black Week, per platform. Bars start at zero. */
.xp-chart { margin: 0; padding: 18px 16px 16px; border-radius: 22px; background: var(--surface-tint); }
.xp-chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 14px; font-size: .8125rem; color: var(--text); }
.xp-chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.xp-chart-unit { margin-left: auto; font-weight: 700; color: var(--muted); }
.xp-key { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.xp-key.is-base, .xp-bar.is-base { background: #CFC6D9; }
.xp-key.is-new, .xp-bar.is-new { background: var(--ink); }
.xp-bars { display: grid; gap: 14px; }
.xp-bar-row { display: grid; grid-template-columns: 4.6em minmax(0, 1fr) 4.2em; align-items: center; gap: 10px; }
.xp-bar-name { font-size: .9375rem; font-weight: 650; color: var(--ink); }
.xp-bar-pair { display: grid; gap: 4px; }
.xp-bar { position: relative; display: flex; align-items: center; justify-content: flex-end; width: var(--w); min-width: 3.6em; height: 24px; padding: 0 8px; border-radius: 6px; }
.xp-bar-val { font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xp-bar.is-base .xp-bar-val { color: var(--ink); }
.xp-bar.is-new .xp-bar-val { color: #fff; }
.xp-bar-delta { justify-self: end; padding: 2px 8px; border-radius: 999px; background: rgba(22, 163, 74, .12); color: var(--xp-win); font-size: .8125rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xp-bar-delta.is-flat { background: var(--surface); color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .xp-bar { animation: xp-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
  .xp-bar.is-new { animation-delay: .12s; }
}
@keyframes xp-grow { from { width: 3.6em; } }

/* (c) Plan options, drawn as a neutral paywall plan picker */
.xp-plans { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.xp-plan { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 2px solid transparent; }
.xp-plan b { display: block; font-size: 1rem; color: var(--ink); }
.xp-plan b + span { font-size: .875rem; color: var(--muted); }
.xp-plan-radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #CFC6D9; }
.xp-plan.is-picked .xp-plan-radio { border: 6px solid var(--ink); }
.xp-plan.is-new { border-color: var(--ia-cta); }
.is-before .xp-plan.is-picked { border-color: var(--line); }

/* (d) Flow: six grey users into one path vs. three reasons x two variants */
.xp-flow { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0 2px; }
.xp-seg-row { display: inline-flex; align-items: center; gap: 6px; }
.xp-seg-grid { display: grid; gap: 6px; }
.xp-seg-why { min-width: 4.6em; font-size: .8125rem; font-weight: 650; color: var(--text); }
.xp-seg { display: inline-block; width: 22px; height: 22px; border-radius: 50%; }
.xp-seg.is-grey { background: #CFC6D9; }
.xp-seg.is-violet { background: var(--violet, #6A5CFF); }
.xp-seg.is-sky { background: #2A9FD6; }
.xp-seg.is-orange { background: var(--orange, #FFAA32); }
.xp-seg.is-light { opacity: .45; }
.xp-flow-arrow { font-size: 1.25rem; line-height: 1; color: var(--muted); }
.xp-flow-box { padding: 10px 14px; border-radius: 14px; background: var(--surface); font-size: .9375rem; font-weight: 650; color: var(--ink); text-align: center; }
.xp-flow-box.is-new { box-shadow: inset 0 0 0 2px var(--ia-cta); }
@media (max-width: 520px) {
  .xp-stats-2 { grid-template-columns: 1fr; }
  .xp-stat-note { flex-basis: 100%; }
  .xp-chart { padding: 16px 14px 14px; }
  .xp-chart-unit { display: none; }
  .xp-bar-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name delta" "bars bars"; row-gap: 6px; }
  .xp-bar-name { grid-area: name; }
  .xp-bar-delta { grid-area: delta; }
  .xp-bar-pair { grid-area: bars; }
}

/* ---------- 2026-11-26: wins visible at a glance, one-line source notes, book button ---------- */
.xp-entry .xp-wd-source { max-width: none; }
.xp-stat-delta::before, .xp-bar-delta:not(.is-flat)::before { content: "▲"; display: inline-block; margin-right: 4px; font-size: .7em; transform: translateY(-1px); }
.xp-stat:has(.xp-stat-delta) { background: rgba(22, 163, 74, .07); box-shadow: inset 0 0 0 1px rgba(22, 163, 74, .22); }
.xp-stat:has(.xp-stat-delta) .xp-stat-vals b { color: var(--xp-win); }
.xp-book { margin: 32px 0 0; text-align: center; }
