/* ================================================================
   LingunAI — the Chrome extension page (/extension)
   Loads after design-system.css, page.css and marketing.css.

   xp-  the page: hero, sections, steps, facts, install, closing band
   xs-  the stage: a faux browser window the demos play in
   xw-  the made-up Spanish blog the learner is "reading"
   x-   the extension's own UI (tooltip, card form, toast), same look and
        wording as extension/content/styles.js
   xa-  a copy of the article page (templates/article.html)

   The stage is drawn at a fixed 960 x 640 and scaled by
   static/js/extension-page.js, which also moves a virtual camera over it.
   ================================================================ */

:root {
  /* The hero and closing band sit on a deeper purple than the buttons do, so
     white text keeps 4.5:1 (white on the button purple is only 4.7:1 at best). */
  --xp-purple: var(--purple-600);
  --xp-on-purple: oklch(98% 0.012 285);
  --xp-on-purple-mute: oklch(94% 0.025 285);
  --xp-ink: var(--neutral-925);
  --xp-on-ink: var(--neutral-50);
  --xp-on-ink-mute: var(--neutral-300);
  --xp-cam: cubic-bezier(0.55, 0, 0.12, 1);
}

.xp-wrap { max-width: 1180px; margin: 0 auto; padding: 0 40px; }

/* No script, no stage: the step lists below carry the same story in words. */
html:not(.xp-js) .xp-stage,
html:not(.xp-js) .xp-hero__visual { display: none; }

/* ── Buttons and links ────────────────────────────────────────── */
.xp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 56px; padding: 0 30px; border-radius: var(--radius-full);
  background: oklch(99% 0.006 285); color: var(--neutral-925);
  font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: -0.01em; line-height: 1;
  box-shadow: 0 1px 0 oklch(100% 0 0 / 0.6) inset, 0 10px 28px oklch(20% 0.1 285 / 0.32);
  transition: transform var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.xp-btn .mk-icon { font-size: 1.25em; }
.xp-btn:hover { color: var(--neutral-925); text-decoration: none; transform: translateY(-2px); box-shadow: 0 1px 0 oklch(100% 0 0 / 0.6) inset, 0 16px 34px oklch(20% 0.1 285 / 0.4); }
.xp-btn:active { transform: scale(0.975); }
.xp-btn:focus-visible { outline: 3px solid oklch(100% 0 0 / 0.9); outline-offset: 3px; border-radius: var(--radius-full); }
.xp-btn--lg { height: 64px; padding: 0 36px; font-size: var(--text-lg); }

.xp-link {
  display: inline-flex; align-items: center; gap: 8px; padding-bottom: 3px;
  border-bottom: 1.5px solid oklch(100% 0 0 / 0.45);
  font-size: var(--text-md); font-weight: var(--weight-medium); color: var(--xp-on-purple);
  transition: border-color var(--duration-fast) var(--ease);
}
.xp-link:hover { color: var(--xp-on-purple); text-decoration: none; border-color: var(--xp-on-purple); }
.xp-link .mk-icon { transition: transform var(--duration-fast) var(--ease); }
.xp-link:hover .mk-icon { transform: translateY(3px) rotate(90deg); }
.xp-link:focus-visible { outline-color: oklch(100% 0 0 / 0.9); }

/* ── Hero ─────────────────────────────────────────────────────── */
.xp-hero {
  background: var(--xp-purple); color: var(--xp-on-purple);
  padding: clamp(52px, 6.5vw, 92px) 0 clamp(64px, 8vw, 112px); overflow: clip;
}
.xp-hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 84px); align-items: center;
}
.xp-hero__copy { min-width: 0; }
.xp-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 15px 6px 13px; border-radius: var(--radius-full);
  background: oklch(16% 0.09 285 / 0.34); border: 1px solid oklch(100% 0 0 / 0.26);
  font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--xp-on-purple);
}
.xp-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--xp-on-purple); }
.xp-h1 {
  margin-top: 24px; max-width: 13ch; color: var(--xp-on-purple);
  font-size: clamp(2.6rem, 5.6vw, 4.6rem); font-weight: var(--weight-bold);
  letter-spacing: -0.034em; line-height: 1.02; text-wrap: balance;
}
.xp-lede {
  margin-top: 24px; max-width: 46ch; color: var(--xp-on-purple-mute);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.6; text-wrap: pretty;
}
.xp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; margin-top: 36px; }
.xp-browser-note {
  margin-top: 16px; max-width: 46ch; padding: 10px 14px; border-radius: var(--radius);
  background: oklch(20% 0.1 285 / 0.35); color: var(--xp-on-purple);
  font-size: var(--text-base); line-height: 1.45;
}
.xp-notes { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 30px; }
.xp-notes li { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-base); color: var(--xp-on-purple-mute); }
.xp-notes .mk-icon { color: var(--xp-on-purple); font-size: 1.05rem; }

.xp-hero__visual { min-width: 0; }

/* ── Sections ─────────────────────────────────────────────────── */
.xp-sec { padding: clamp(72px, 9vw, 128px) 0; }
.xp-sec--paper { background: var(--bg); }
.xp-sec--soft { background: var(--surface-2); border-block: 1px solid var(--border); }
.xp-sec--ink { background: var(--xp-ink); color: var(--xp-on-ink); }

.xp-head {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 20px clamp(32px, 6vw, 88px);
  align-items: end; margin-bottom: clamp(36px, 5vw, 64px);
}
.xp-head--stack { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin-bottom: 0; }
.xp-h2 {
  font-size: clamp(2rem, 4.1vw, 3.35rem); font-weight: var(--weight-bold);
  letter-spacing: -0.03em; line-height: 1.06; text-wrap: balance;
}
.xp-sub { max-width: 50ch; font-size: var(--text-lg); line-height: 1.6; color: var(--text-mute); text-wrap: pretty; }
.xp-sec--ink .xp-h2 { color: var(--xp-on-ink); }
.xp-sec--ink .xp-sub { color: var(--xp-on-ink-mute); }

/* ── Demo: step list beside the stage ─────────────────────────── */
.xp-demo {
  display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: clamp(28px, 3.6vw, 48px); align-items: start;
}
.xp-steps { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; }
.xp-step { position: relative; }
.xp-step__btn {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 16px;
  padding: 15px 14px 20px; border-radius: var(--radius-lg);
  transition: background var(--duration) var(--ease);
}
.xp-step__btn:hover { background: var(--accent-soft); }
.xp-step__btn:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.xp-step__n {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); color: var(--text-mute);
  font-size: var(--text-base); font-weight: var(--weight-semibold);
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}
.xp-step__t {
  display: block; padding-top: 5px; font-size: var(--text-lg); font-weight: var(--weight-semibold);
  letter-spacing: -0.018em; line-height: 1.25; color: var(--text-mute);
  transition: color var(--duration) var(--ease);
}
/* the text of a step opens under the active one (grid-rows, not height) */
.xp-step__x { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--duration-slow) var(--ease), opacity var(--duration-slow) var(--ease); }
.xp-step__x > span { overflow: hidden; display: block; padding-top: 8px; font-size: var(--text-base); line-height: 1.55; color: var(--text-mute); text-wrap: pretty; }
html.xp-js .xp-step:not(.is-on) .xp-step__x { grid-template-rows: 0fr; opacity: 0; }
.xp-step.is-on .xp-step__n { background: var(--accent); border-color: var(--accent); color: #fff; }
.xp-step.is-on .xp-step__t { color: var(--text); }
.xp-step__bar {
  position: absolute; left: 64px; right: 14px; bottom: 9px; height: 2px; border-radius: 2px;
  background: var(--border); opacity: 0; overflow: hidden; transition: opacity var(--duration) var(--ease);
}
.xp-step__bar::after {
  content: ''; position: absolute; inset: 0; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
}
.xp-step.is-on .xp-step__bar { opacity: 1; }
.xp-step.is-on.is-playing .xp-step__bar::after { animation: xp-progress var(--step-ms, 4000ms) linear forwards; }
.xp-step.is-on:not(.is-playing) .xp-step__bar::after { transform: scaleX(1); }
@keyframes xp-progress { to { transform: scaleX(1); } }

.xp-sec--ink .xp-step__btn:hover { background: oklch(100% 0 0 / 0.07); }
.xp-sec--ink .xp-step__n { border-color: oklch(100% 0 0 / 0.28); color: var(--xp-on-ink-mute); }
.xp-sec--ink .xp-step__t, .xp-sec--ink .xp-step__x > span { color: var(--xp-on-ink-mute); }
.xp-sec--ink .xp-step.is-on .xp-step__t { color: var(--xp-on-ink); }
.xp-sec--ink .xp-step.is-on .xp-step__n { color: #fff; }
.xp-sec--ink .xp-step__bar { background: oklch(100% 0 0 / 0.16); }
.xp-sec--ink .xp-step__bar::after { background: var(--purple-300); }

.xp-stage { position: relative; min-width: 0; }
.xp-stage__ctl { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.xp-ctl {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text); font-size: 1.05rem; cursor: pointer;
  transition: background var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}
.xp-ctl:hover { background: var(--accent-soft); border-color: var(--accent); }
.xp-ctl:focus-visible { box-shadow: 0 0 0 3px var(--accent); outline: none; }
.xp-ctl__play { display: none; }
.xp-ctl[aria-pressed="true"] .xp-ctl__pause { display: none; }
.xp-ctl[aria-pressed="true"] .xp-ctl__play { display: inline-flex; }
.xp-stage__note { font-size: var(--text-sm); line-height: 1.4; color: var(--text-mute); }
.xp-sec--ink .xp-ctl { border-color: oklch(100% 0 0 / 0.3); color: var(--xp-on-ink); }
.xp-sec--ink .xp-ctl:hover { background: oklch(100% 0 0 / 0.08); border-color: var(--purple-300); }
.xp-sec--ink .xp-stage__note { color: var(--xp-on-ink-mute); }

/* ── Privacy ──────────────────────────────────────────────────── */
.xp-privacy { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 48px clamp(40px, 7vw, 104px); align-items: start; }
.xp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; border-top: 1px solid var(--border-strong); }
.xp-fact { padding: 24px 0 28px; border-bottom: 1px solid var(--border-strong); }
.xp-fact dt { font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: -0.015em; line-height: 1.3; color: var(--text); }
.xp-fact dd { margin-top: 10px; font-size: var(--text-base); line-height: 1.6; color: var(--text-mute); text-wrap: pretty; }

/* ── Install ──────────────────────────────────────────────────── */
.xp-install { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px clamp(24px, 3vw, 40px); }
.xp-install__art {
  display: grid; place-items: center; height: 200px; margin-bottom: 26px; padding: 18px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2);
}
.xp-install__n { font-size: 13px; font-weight: var(--weight-semibold); letter-spacing: var(--tracking-widest); color: var(--accent-text); }
.xp-install__t { margin-top: 10px; font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: -0.02em; line-height: 1.2; }
.xp-install__x { margin-top: 10px; max-width: 36ch; font-size: var(--text-base); line-height: 1.6; color: var(--text-mute); text-wrap: pretty; }
.xp-install__more { margin-top: 36px; }

/* ── Closing band ─────────────────────────────────────────────── */
main > .xp-band { padding: clamp(72px, 9vw, 120px) 0; background: var(--xp-purple); color: var(--xp-on-purple); }
.xp-band__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px clamp(32px, 6vw, 88px); align-items: end; }
.xp-band__t {
  max-width: 17ch; color: var(--xp-on-purple); text-wrap: balance;
  font-size: clamp(2.1rem, 4.8vw, 3.8rem); font-weight: var(--weight-bold); letter-spacing: -0.032em; line-height: 1.03;
}
.xp-band__x { margin-top: 20px; max-width: 46ch; font-size: var(--text-lg); line-height: 1.55; color: var(--xp-on-purple-mute); }

/* ── Motion on the page itself ────────────────────────────────── */
@keyframes xp-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
html.xp-js .xp-hero__copy > * { animation: xp-rise 0.9s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms + 60ms); }
html.xp-js .xp-hero__visual { animation: xp-rise 1.1s var(--ease) 280ms both; }
.xp-hero__copy > :nth-child(1) { --i: 0; } .xp-hero__copy > :nth-child(2) { --i: 1; } .xp-hero__copy > :nth-child(3) { --i: 2; }
.xp-hero__copy > :nth-child(4) { --i: 3; } .xp-hero__copy > :nth-child(5) { --i: 4; } .xp-hero__copy > :nth-child(6) { --i: 4; }
html.xp-reveal .xp-fact, html.xp-reveal .xp-install__item { opacity: 0; transform: translateY(18px); }
html.xp-reveal .xp-fact.is-in, html.xp-reveal .xp-install__item.is-in {
  opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--n, 0) * 90ms);
}

/* the FAQ is shared with the other public pages; here its numbers are set to read at 4.5:1 */
.xp-sec--paper + .mk-faq { padding-top: 0; }
.mk-faq__num { color: var(--text-mute); }

/* ================================================================
   The stage
   ================================================================ */
.xs {
  --x-surface: #fff; --x-surface-2: #f4f5f8; --x-border: #d6d8e0; --x-text: #14141b; --x-mute: #5f5d6e;
  --x-accent: #745ede; --x-accent-2: #5a4fd4; --x-ok: #16a34a;
  --x-shadow: 0 12px 40px rgba(20, 20, 27, 0.22);
  --x-ai-bg: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
  --x-ai-border: rgba(118, 75, 162, 0.25);
  position: relative; font-family: var(--font-sans); color: var(--x-text); line-height: 1.4;
  -webkit-font-smoothing: antialiased; user-select: none;
}
.xs-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.xi { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.xs-win {
  border-radius: 14px; overflow: hidden; background: #dcdfe5; isolation: isolate;
  border: 1px solid rgb(20 20 40 / 0.12);
  box-shadow: 0 2px 6px rgb(20 20 40 / 0.1), 0 40px 90px -30px rgb(20 20 40 / 0.5);
}
.xp-sec--ink .xs-win {
  border-color: oklch(100% 0 0 / 0.14);
  box-shadow: 0 0 0 1px oklch(0% 0 0 / 0.5), 0 40px 100px -24px oklch(58% 0.165 285 / 0.45);
}

/* browser chrome: real pixels, not scaled with the page */
.xs-chrome { background: #dcdfe5; color: #3c4043; font-size: 12.5px; }
.xs-tabbar { display: flex; align-items: flex-end; gap: 14px; height: 38px; padding: 8px 12px 0; }
.xs-dots { display: flex; gap: 7px; align-self: center; padding-bottom: 8px; }
.xs-dots i { width: 11px; height: 11px; border-radius: 50%; background: #b9bec6; }
.xs-tabs { display: flex; align-items: flex-end; gap: 2px; flex: 1; min-width: 0; }
.xs-tab {
  display: flex; align-items: center; gap: 8px; height: 30px; min-width: 0; max-width: 230px; padding: 0 14px;
  border-radius: 10px 10px 0 0; color: #5f6368; white-space: nowrap;
  transition: max-width 0.45s var(--ease), padding 0.45s var(--ease), opacity 0.3s var(--ease), background 0.2s;
}
.xs-tab.is-on { background: #fff; color: #202124; }
.xs-tab[data-tab="app"] { max-width: 0; padding: 0; opacity: 0; overflow: hidden; }
.xs-tab[data-tab="app"].is-in { max-width: 230px; padding: 0 14px; opacity: 1; }
.xs-tab-t { overflow: hidden; text-overflow: ellipsis; }
.xs-fav { flex: none; width: 14px; height: 14px; border-radius: 3px; }
.xs-fav--site { display: grid; place-items: center; background: #e4572e; color: #fff; font: italic 700 9px/1 Georgia, serif; }
.xs-addr { display: flex; align-items: center; gap: 12px; padding: 7px 12px 8px; background: #fff; }
.xs-nav { display: flex; gap: 12px; color: #5f6368; font-size: 15px; }
.xs-url {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; height: 28px; padding: 0 14px;
  border-radius: 14px; background: #f1f3f4; color: #3c4043; white-space: nowrap; overflow: hidden;
}
.xs-url .xi { font-size: 12px; color: #5f6368; }
.xs-ext { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; }

/* the screen: a fixed 960 x 640 page under a virtual camera */
.xs-screen { position: relative; overflow: hidden; background: #fbfaf7; aspect-ratio: 3 / 2; container: scr / inline-size; }
.xs-cam {
  position: absolute; left: 0; top: 0; width: 960px; height: 640px; transform-origin: 0 0;
  transition: transform var(--cam-ms, 900ms) var(--xp-cam);
}
.xs:not(.is-ready) .xs-cam { visibility: hidden; }
.xs-page { position: absolute; inset: 0; transition: opacity 0.35s var(--ease), filter 0.4s var(--ease); }
.xs-page--app { opacity: 0; visibility: hidden; }
.xs[data-active="app"] .xs-page--app { opacity: 1; visibility: visible; }
.xs[data-active="app"] .xs-page--site { opacity: 0; visibility: hidden; }
.xs.is-modal .xs-page { filter: blur(3px); }

/* a soft cut between takes (a loop restarting, or a visitor jumping to a step) */
.xs [data-screen] { transition: opacity 0.24s var(--ease); }
.xs.is-cut [data-screen] { opacity: 0; }

/* snapshot mode: jump to a state without animating (the engine adds it for one frame) */
.xs.is-snap, .xs.is-snap * { transition: none !important; animation: none !important; }

.xs-ui { position: absolute; inset: 0; font-size: 16px; pointer-events: none; }
/* the selection is painted behind the text, as a browser does (no blending, so rows join without seams) */
.x-hl-layer { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.x-hl { position: absolute; background: #b3d4fc; transform-origin: 0 50%; }
.x-hl.is-sweep { animation: x-sweep var(--sw, 150ms) var(--ease) both; animation-delay: calc(var(--i, 0) * var(--gap, 70ms)); }
@keyframes x-sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ── The extension's UI (extension/content/styles.js) ─────────── */
.x-tip {
  position: absolute; z-index: 5; display: flex; align-items: center; gap: 0.65em; padding: 0.45em 0.5em 0.45em 0.9em;
  background: var(--x-surface); border-radius: 0.9em; box-shadow: var(--x-shadow); white-space: nowrap;
  opacity: 0; visibility: hidden; transform: translateY(6px) scale(0.96); transform-origin: 50% 100%;
  transition: opacity 0.18s var(--ease), transform 0.24s var(--ease), visibility 0s linear 0.24s;
}
.x-tip.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.x-tip-word { max-width: 12em; overflow: hidden; text-overflow: ellipsis; font-size: 0.9em; color: var(--x-mute); }
.x-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 0.55em 1em; border-radius: 0.65em;
  font-size: 0.85em; font-weight: 700; line-height: 1.4; white-space: nowrap;
  transition: transform 0.12s var(--ease), filter 0.12s var(--ease);
}
.x-btn[hidden] { display: none; }
.x-btn--primary { color: #fff; background: linear-gradient(135deg, var(--x-accent), var(--x-accent-2)); }
.x-btn--ghost { color: var(--x-text); background: transparent; border: 1px solid var(--x-border); font-weight: 600; }
.x-btn--ai { gap: 0.4em; font-size: 0.82em; color: #fff; background: linear-gradient(135deg, #667eea, #764ba2); }
.x-btn--grow { flex: 1; padding: 0.8em; font-size: 0.95em; }
.x-btn.is-hover { filter: brightness(1.08); }
.x-btn.is-down { transform: scale(0.95); }
.x-btn--ai.is-busy { opacity: 0.6; }

.x-overlay {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 1em;
  background: rgba(0, 0, 0, 0.6); opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}
.x-overlay.is-on { opacity: 1; visibility: visible; transition-delay: 0s; }
.x-modal {
  width: 100%; max-width: 36.25em; padding: 1.15em 1.6em 1.3em; background: var(--x-surface);
  border-radius: 1.25em; box-shadow: var(--x-shadow);
  transform: translateY(14px) scale(0.97); transition: transform 0.4s var(--ease);
}
.x-overlay.is-on .x-modal { transform: none; }
/* on a phone the card form is narrower, so the camera can film all of it at a size you can read */
@container scr (max-width: 560px) { .x-modal { max-width: 24em; } }
.x-mhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7em; }
.x-mtitle { font-size: 1.15em; font-weight: 700; }
.x-close { padding: 0 0.3em; font-size: 1.5em; line-height: 1; color: var(--x-mute); }
.x-aibar {
  display: flex; align-items: center; gap: 0.75em; margin-bottom: 0.8em; padding: 0.65em 1em;
  background: var(--x-ai-bg); border: 1px solid var(--x-ai-border); border-radius: 0.9em;
}
.x-aistatus { font-size: 0.8em; color: var(--x-accent); }
.x-aistatus.is-thinking { animation: x-pulse 1s ease-in-out infinite; }
@keyframes x-pulse { 50% { opacity: 0.45; } }
.x-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85em; }
.x-field { display: flex; flex-direction: column; gap: 0.3em; min-width: 0; margin-bottom: 0.7em; }
.x-label { font-size: 0.72em; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.x-in {
  display: flex; align-items: center; min-height: 2.55em; padding: 0.55em 0.8em; overflow: hidden;
  background: var(--x-surface-2); border: 1px solid var(--x-border); border-radius: 0.6em;
  font-size: 0.92em; line-height: 1.35; white-space: nowrap;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.x-in--ta { align-items: flex-start; min-height: 4.1em; white-space: normal; }
.x-in--sel { justify-content: space-between; }
.x-in:empty::before { content: attr(data-ph); color: #9a98a8; }
.x-in.is-typing { border-color: var(--x-accent); box-shadow: 0 0 0 3px rgba(124, 106, 247, 0.2); }
.x-in.is-typing::after { content: ''; flex: none; width: 1.5px; height: 1.15em; margin-left: 1px; background: var(--x-accent); animation: x-caret 0.9s steps(1) infinite; }
@keyframes x-caret { 50% { opacity: 0; } }
.x-caret { flex: none; width: 0.45em; height: 0.45em; margin: -0.2em 0.1em 0 0; border-right: 2px solid var(--x-mute); border-bottom: 2px solid var(--x-mute); transform: rotate(45deg); }
.x-actions { display: flex; gap: 0.75em; margin-top: 0.3em; }

.x-toast {
  position: absolute; right: 1.25em; bottom: 1.25em; z-index: 7; padding: 0.75em 1.1em; border-radius: 0.75em;
  background: var(--x-ok); color: #fff; font-size: 0.9em; font-weight: 600; box-shadow: var(--x-shadow);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease), visibility 0s linear 0.35s;
}
.x-toast.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* ── Cursor ───────────────────────────────────────────────────── */
.xs-cursor { position: absolute; left: 0; top: 0; z-index: 20; pointer-events: none; transform: translate(880px, 590px); filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.35)); }
.xs-cursor svg { display: block; transform-origin: 3px 2px; transition: transform 0.12s var(--ease); }
.xs-cursor.is-down svg { transform: scale(0.84); }
.xs-ripple { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--x-accent); opacity: 0; }
.xs-cursor.is-click .xs-ripple { animation: xs-ripple 0.55s var(--ease); }
@keyframes xs-ripple { 0% { opacity: 0.8; transform: scale(0.3); } 100% { opacity: 0; transform: scale(1.6); } }

/* ── The blog being read ──────────────────────────────────────── */
.xw { position: relative; width: 960px; height: 640px; overflow: hidden; background: #fbfaf7; color: #26241f; font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif; }
.xw::after { content: ''; position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(to top, #fbfaf7 15%, rgb(251 250 247 / 0)); }
.xw-top, .xw-art, .xh-meta, .xh-p { position: relative; z-index: 1; }
.xw-top { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 56px; border-bottom: 1px solid #e8e4da; }
.xw-logo { font-size: 24px; font-style: italic; font-weight: 700; letter-spacing: -0.01em; color: #e4572e; }
.xw-nav { display: flex; gap: 28px; font: 500 13px/1 var(--font-sans); color: #6b675d; }
.xw-art { width: 620px; margin: 0 auto; padding-top: 30px; }
.xw-kicker { font: 600 12px/1 var(--font-sans); letter-spacing: 0.14em; text-transform: uppercase; color: #e4572e; }
.xw-h1 { margin-top: 12px; font-size: 41px; font-weight: 700; line-height: 1.1; letter-spacing: -0.018em; }
.xw-by { margin-top: 12px; font: 400 13px/1 var(--font-sans); color: #7d796f; }
.xw-p { margin-top: 20px; font-size: 18.5px; line-height: 1.6; color: #2c2a25; }

/* ── The article page, as the app draws it ────────────────────── */
.xa {
  --a-border: #e7e8ee; --a-mute: #5f5d6e; --a-dim: #8d8b9b; --a-accent: #745ede; --a-accent-text: #5a45c2;
  --a-soft: oklch(58% 0.165 285 / 0.1); --a-line: oklch(58% 0.165 285 / 0.22);
  position: relative; display: grid; grid-template-columns: 176px minmax(0, 1fr); width: 960px; height: 640px;
  background: #fff; color: #14141b; font-family: var(--font-sans);
}
.xa-side { display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; border-right: 1px solid var(--a-border); }
.xa-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.xa-logo { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--a-accent); color: #fff; font-style: normal; font-size: 14px; font-weight: 700; }
.xa-link { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 9px; font-size: 13.5px; color: var(--a-mute); }
.xa-link .xi { font-size: 16px; }
.xa-link.is-on { background: var(--a-soft); color: var(--a-accent-text); font-weight: 600; }
.xa-group { margin: 12px 0 4px; padding: 0 10px; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--a-dim); }
.xa-credits { margin-top: auto; padding: 10px 12px; border: 1px solid var(--a-border); border-radius: 12px; font-size: 11.5px; color: var(--a-mute); }
.xa-credits-t { display: flex; justify-content: space-between; color: #14141b; }
.xa-credits-bar { height: 4px; margin-top: 8px; border-radius: 4px; background: var(--a-line); overflow: hidden; }
.xa-credits-bar i { display: block; width: 100%; height: 100%; background: var(--a-accent); }

.xa-main { position: relative; min-width: 0; }
.xa-v { position: absolute; inset: 0; padding: 20px 28px; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), visibility 0s linear 0.4s; }
.xa[data-view="compose"] .xa-v--compose,
.xa[data-view="working"] .xa-v--working,
.xa[data-view="result"] .xa-v--result { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.xa-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--a-accent-text); }
.xa-eyebrow .xi { font-size: 13px; }
.xa-h1 { margin-top: 6px; font-size: 25px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.xa-sub { margin-top: 6px; max-width: 540px; font-size: 12.5px; line-height: 1.5; color: var(--a-mute); }
.xa-grid { display: grid; grid-template-columns: minmax(0, 1fr) 206px; gap: 14px; margin-top: 16px; }
.xa-panel { padding: 12px 14px 10px; border: 1px solid var(--a-border); border-radius: 14px; }
.xa-phead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.xa-lab { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--a-dim); }
.xa-hint { font-size: 10.5px; color: var(--a-dim); }
.xa-note {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; padding: 8px 11px; border-radius: 9px;
  background: var(--a-soft); border: 1px solid var(--a-line); font-size: 11.5px; line-height: 1.4; color: var(--a-accent-text);
  opacity: 0; transform: translateY(-4px); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.xa-note .xi { margin-top: 1px; font-size: 13px; }
.xa-note.is-on { opacity: 1; transform: none; }
.xa-title { margin-top: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--a-border); font-size: 14px; font-weight: 500; color: #a3a1b0; }
.xa-ta {
  position: relative; margin-top: 8px; height: 214px; padding: 8px 10px; overflow: hidden; border: 1.5px solid var(--a-border); border-radius: 9px;
  font-size: 12px; line-height: 1.62; white-space: pre-wrap; color: #14141b; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.xa-ta.is-focus { border-color: var(--a-accent); box-shadow: 0 0 0 3px var(--a-soft); }
.xa-ta span { transition: opacity 0.3s var(--ease); }
.xa-pfoot { display: flex; justify-content: space-between; margin-top: 8px; }
.xa-count { font-size: 10.5px; color: var(--a-dim); transition: color 0.3s var(--ease); }
.xa-count.is-ready { color: #16a34a; }
.xa-rail { display: flex; flex-direction: column; gap: 10px; }
.xa-block { padding: 11px 12px; border: 1px solid var(--a-border); border-radius: 14px; }
.xa-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.xa-chips span { padding: 4px 10px; border: 1px solid var(--a-border); border-radius: 999px; font-size: 11px; color: var(--a-mute); }
.xa-chips .is-on { background: var(--a-accent); border-color: var(--a-accent); color: #fff; font-weight: 600; }
.xa-levels { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.xa-levels li { display: flex; align-items: center; gap: 12px; padding: 5px 9px; border: 1px solid transparent; border-radius: 8px; font-size: 11.5px; color: var(--a-mute); transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease); }
.xa-levels b { width: 20px; font-size: 11px; color: #14141b; }
.xa-levels li.is-on { background: var(--a-soft); border-color: var(--a-line); color: var(--a-accent-text); }
.xa-go { display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: 11px; background: var(--a-accent); color: #fff; font-size: 13px; font-weight: 700; transition: transform 0.12s var(--ease), filter 0.12s var(--ease); }
.xa-go .xi { font-size: 15px; }
.xa-go.is-hover { filter: brightness(1.08); }
.xa-go.is-down { transform: scale(0.97); }

.xa-working { position: absolute; left: 50%; top: 50%; width: 360px; padding: 34px 30px 30px; transform: translate(-50%, -50%); text-align: center; border: 1px solid var(--a-border); border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgb(20 20 40 / 0.08); }
.xa-spin { display: block; width: 34px; height: 34px; margin: 0 auto 16px; border: 3px solid var(--a-line); border-top-color: var(--a-accent); border-radius: 50%; animation: xa-spin 0.9s linear infinite; }
@keyframes xa-spin { to { transform: rotate(360deg); } }
.xa-wt { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; transition: opacity 0.2s var(--ease); }
.xa-ws { margin-top: 8px; font-size: 12px; line-height: 1.5; color: var(--a-mute); }
.xa-ws b { color: #14141b; }
.xa-wbar { height: 4px; margin-top: 18px; border-radius: 4px; background: var(--a-line); overflow: hidden; }
.xa-wbar i { display: block; width: 40%; height: 100%; border-radius: 4px; background: var(--a-accent); animation: xa-bar 1.4s var(--ease) infinite; }
@keyframes xa-bar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.xa-toolbar { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--a-border); }
.xa-back { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--a-border); border-radius: 9px; font-size: 12px; font-weight: 600; }
.xa-badges { display: flex; align-items: center; gap: 6px; }
.xa-tag { padding: 2px 9px; border: 1px solid var(--a-border); border-radius: 6px; background: #f4f5f8; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--a-mute); }
.xa-tag--on { background: var(--a-soft); border-color: var(--a-line); color: var(--a-accent-text); }
.xa-read { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 24px; margin-top: 16px; }
.xa-rh1 { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.xa-body { margin-top: 14px; }
.xa-body p { margin-bottom: 12px; font-size: 14.5px; line-height: 1.7; opacity: 0; transform: translateY(8px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 170ms + 150ms); }
.xa[data-view="result"] .xa-body p { opacity: 1; transform: none; }
.xa-vhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.xa-vcard { margin-bottom: 8px; padding: 10px 12px 11px; border: 1px solid var(--a-border); border-radius: 12px; opacity: 0; transform: translateY(10px); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 150ms + 450ms); }
.xa[data-view="result"] .xa-vcard { opacity: 1; transform: none; }
.xa-vtop { display: flex; align-items: center; justify-content: space-between; }
.xa-vtop b { font-size: 14px; }
.xa-spk { display: grid; place-items: center; width: 24px; height: 24px; padding: 5px; border: 1px solid var(--a-border); border-radius: 7px; color: var(--a-mute); }
.xa-vdef { margin-top: 5px; font-size: 11.5px; line-height: 1.4; color: var(--a-mute); }
.xa-vex { margin-top: 4px; font-size: 11px; font-style: italic; line-height: 1.4; color: var(--a-dim); }
.xa-add { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 4px 10px; border: 1px solid var(--a-border); border-radius: 7px; font-size: 11px; font-weight: 600; transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.12s var(--ease); }
.xa-add .xi { font-size: 12px; }
.xa-add.is-hover { border-color: var(--a-accent); }
.xa-add.is-down { transform: scale(0.95); }
.xa-add.is-done { background: var(--a-soft); border-color: var(--a-line); color: var(--a-accent-text); }

/* ── Hero close-up ────────────────────────────────────────────── */
.xs--hero { max-width: 560px; margin-inline: auto; }
.xh-card { position: relative; overflow: hidden; container-type: inline-size; border-radius: 22px; background: #fbfaf7; box-shadow: 0 50px 100px -30px oklch(18% 0.12 285 / 0.8), 0 0 0 1px oklch(0% 0 0 / 0.1); }
.xh-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: #e9e6df; }
.xh-bar .xs-dots { padding-bottom: 0; }
.xh-url { display: flex; align-items: center; gap: 7px; flex: 1; height: 26px; padding: 0 12px; border-radius: 13px; background: #f7f5f0; font: 500 12px/1 var(--font-sans); color: #6b675d; }
.xh-url .xi { font-size: 11px; }
.xh-body { position: relative; padding: clamp(26px, 4vw, 42px) clamp(24px, 3.6vw, 40px) clamp(74px, 9vw, 104px); }
.xh-meta { font: 600 12px/1 var(--font-sans); letter-spacing: 0.12em; text-transform: uppercase; color: #e4572e; }
.xh-p { margin-top: clamp(58px, 7vw, 76px); font: 400 clamp(1.3rem, 2.5vw, 1.95rem)/1.5 Georgia, 'Iowan Old Style', 'Times New Roman', serif; color: #26241f; }
/* the tooltip scales with the card it sits on, so it fits a phone as well as a desktop */
.xs--hero .xs-ui { font-size: clamp(10px, 3.3cqw, 18px); }

/* the same close-up on a white page (landing page): a lavender stage under the paper */
.xs--onlight { max-width: 640px; margin-inline: 0; padding: clamp(16px, 2.6vw, 32px); border-radius: 28px; background: var(--accent-soft); }
.xs--onlight .xh-card { box-shadow: 0 36px 70px -34px hsl(250 50% 28% / 0.45), 0 0 0 1px oklch(0% 0 0 / 0.08); }
.xp-land { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
@media (max-width: 900px) { .xp-land { grid-template-columns: minmax(0, 1fr); } }
.xs--hero .xs-cursor { transform: translate(300px, 260px); }

/* ── Small pictures in the install steps ──────────────────────── */
.xs--mini { display: grid; place-items: center; width: 100%; }
.xm-menu, .xm-pop {
  width: min(100%, 290px); background: var(--x-surface); border: 1px solid var(--x-border);
  border-radius: 14px; box-shadow: var(--x-shadow);
}
.xm-menu { padding: 10px 8px; }
.xm-menu-h { padding: 4px 10px 8px; font-size: 12px; font-weight: 600; color: var(--x-mute); }
.xm-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--x-surface-2); font-size: 14px; font-weight: 500; }
.xm-row span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xm-row img { flex: none; border-radius: 6px; }
.xm-pin { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgb(116 94 222 / 0.16); color: var(--x-accent); font-size: 17px; }
.xm-pin .xi { fill: currentColor; fill-opacity: 0.3; }
.xm-pop { width: min(100%, 272px); padding: 16px 16px 18px; }
.xm-pop-h { margin-bottom: 8px; font-size: 15px; font-weight: 700; }
.xm-pop p { margin-bottom: 14px; font-size: 12.5px; line-height: 1.5; color: var(--x-mute); }
.xm-block { display: flex; width: 100%; padding: 0.7em 1em; font-size: 13.5px; }
.xm-read { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.xm-read p {
  padding: 14px 18px; border: 1px solid #e8e4da; border-radius: 12px; background: #fbfaf7;
  font: 400 18px/1.4 Georgia, 'Iowan Old Style', 'Times New Roman', serif; color: #26241f; text-align: center;
}
.xm-read mark { padding: 0 1px; background: #b2d4ff; color: inherit; }
.xm-tip { position: relative; font-size: 13px; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .xp-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 52px; }
  .xp-h1 { max-width: 16ch; }
  .xs--hero { max-width: 720px; margin-inline: 0; }
  .xp-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .xp-demo { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .xp-stage { order: -1; }
  .xp-steps { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
  .xp-privacy { grid-template-columns: minmax(0, 1fr); }
  .xp-install { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .xp-band__grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
}

@media (max-width: 760px) {
  .xp-wrap { padding: 0 20px; }
  .xp-steps { grid-template-columns: minmax(0, 1fr); }
  .xp-facts { grid-template-columns: minmax(0, 1fr); }
  .xp-btn { height: 54px; padding: 0 26px; }
  .xp-btn--lg { height: 58px; }
  .xs-screen { aspect-ratio: 4 / 5; }
  .xs-tab-t { max-width: 18ch; }
  .xs-nav { display: none; }
  .xs-dots { display: none; }
  .xs--hero .xs-cursor { transform: translate(200px, 220px); }
  .xp-stage__note { font-size: 12px; }
}

@media (max-width: 440px) {
  .xp-hero { padding-top: 40px; }
  .xp-actions { gap: 18px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .xp-btn:hover, .xp-link:hover .mk-icon { transform: none; }
  .xs *, .xs-cam, .xp-step__x, .xp-step__bar::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .xa-spin { animation: none; border-top-color: var(--a-line); }
}
