/* FRRO Form-C AutoFiller website.
   Tokens and component looks follow frro-chrome-extension/DESIGN.md and its assets/*.css. */

/* Plus Jakarta Sans, self-hosted (files from @fontsource-variable/plus-jakarta-sans). */
@font-face {
  font-family: "Plus Jakarta Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/assets/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Plus Jakarta Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/assets/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-sans: "Plus Jakarta Sans Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #0b1120;
  --sidebar: #0f172a;
  --surface: #111a2e;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --text-3: #a3b1c6;
  --muted: #8b9ab0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(59, 130, 246, 0.14);
  --primary-text: #93c5fd;
  --link: #7fb0ff;
  --green: #4ade80;
  --amber: #fbbf24;
  --radius-sm: 12px;
  --radius: 20px;
  --control-h: 48px;
}

/* Plan tiers: one colour each. */
.tier--lite { --tier: #67e8f9; --tier-soft: rgba(103, 232, 249, 0.12); }
.tier--pro { --tier: #a78bfa; --tier-soft: rgba(167, 139, 250, 0.16); }
.tier--max { --tier: #f472b6; --tier-soft: rgba(244, 114, 182, 0.14); }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, p, ul, ol { margin: 0; }
address { font-style: normal; }
button { font: inherit; }
a { color: var(--link); }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--primary-text);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons and chips ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-h);
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  border-color: var(--border-strong);
  color: #e2e8f0;
  font-weight: 600;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.4);
}

/* "Coming soon" state of the store button. */
.btn:disabled {
  background: rgba(148, 163, 184, 0.14);
  border-color: var(--border-strong);
  color: var(--text-3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.chip svg { width: 16px; height: 16px; margin-right: 6px; }
.chip--neutral { background: rgba(148, 163, 184, 0.14); color: var(--text-2); }
.chip--green { background: rgba(74, 222, 128, 0.16); color: var(--green); }

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #ec4899);
  color: #fff;
  font-weight: 800;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-right: auto;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
}

.site-nav { display: flex; gap: 4px; }

.site-nav a {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden; /* keeps the glows from adding a horizontal scroll */
  padding: 72px 0 88px;
}

/* Soft brand-colour glows behind the popup. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  pointer-events: none;
  animation: glow-drift 16s ease-in-out infinite alternate;
}

.hero::before {
  top: -160px;
  right: -120px;
  background: radial-gradient(closest-side, rgba(59, 130, 246, 0.28), transparent);
}

.hero::after {
  right: 200px;
  bottom: -300px;
  background: radial-gradient(closest-side, rgba(236, 72, 153, 0.18), transparent);
  animation-delay: -8s;
}

@keyframes glow-drift {
  to { transform: translate(-40px, 30px) scale(1.1); }
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 56px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

.eyebrow {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-text);
}

.hero h1 {
  font-size: clamp(32px, 4.6vw, 48px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-lead {
  max-width: 560px;
  font-size: 18px;
  color: var(--text-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.hero-note {
  font-size: 15px;
  color: var(--text-3);
}

/* ── Popup mock (drawn in HTML/CSS, modelled on the extension popup) ── */
.demo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

/* The window the camera looks through; it clips the world behind it. */
.demo__frame {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* The world: a browser page with the extension popup at its top right. The popup is laid out
   at full size (it gives the world its size) and drawn at --p of it, --mx from the right edge
   and --my from the top. The camera is the world's transform: by default it is zoomed onto the
   popup, so the popup fills the frame; in step 3 it pulls back to show the whole page. */
.demo {
  --p: 0.44;
  --mx: 0.025;
  --my: 0.075;
}

.world {
  position: relative;
  transform-origin: 0 0;
  transform:
    translate(calc((1 - var(--mx) - var(--p)) / var(--p) * -100%), calc(var(--my) / var(--p) * -100%))
    scale(calc(1 / var(--p)));
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.demo[data-step="3"] .world {
  transform: none;
  transition: transform 1200ms cubic-bezier(0.65, 0, 0.35, 1) 400ms;
}

.mock {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  /* The ring hides hairline gaps at the frame's edge while the camera is on the popup. */
  box-shadow: 0 0 0 3px var(--bg), 0 30px 60px rgba(0, 0, 0, 0.55);
  font-size: 14px;
  user-select: none;
  transform-origin: 100% 0;
  transform: translate(calc(var(--mx) * -100%), calc(var(--my) * 100%)) scale(var(--p));
}

.mock svg { flex: none; }

.mock__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mock__head .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.mock__titles {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.mock__titles b { font-size: 15px; font-weight: 800; }
.mock__titles span { font-size: 12px; color: var(--text-3); }

.mock__cog {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
}

.mock__cog svg { width: 18px; height: 18px; }

.mock__plan {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.mock__plan > span { color: var(--text-2); }

/* One autofill is used once the details are read. */
.demo[data-step="1"] .mock__after,
.demo:not([data-step="1"]) .mock__before { display: none; }

/* The three scenes share one grid cell; only the current one shows. */
.mock__stage { display: grid; }

.scene {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.97);
  transition: opacity 250ms ease, visibility 250ms, transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* In step 3 the popup keeps showing the review, while the web page behind it gets filled. */
.demo[data-step="1"] .scene--upload,
.demo[data-step="2"] .scene--review,
.demo[data-step="3"] .scene--review {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* Scene 1: upload tiles */
.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 200px;
  border-radius: 14px;
  border: 1.5px dashed rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.tile > svg { width: 28px; height: 28px; color: var(--link); }
.tile > b { font-size: 15px; }
.tile > span { font-size: 12px; color: var(--text-3); }

/* The added photo covers the empty tile. */
.tile__doc {
  position: absolute;
  inset: -1.5px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}

.tile__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(11, 17, 32, 0.85);
  font-size: 12px;
  font-weight: 600;
}

/* A made-up document drawn with boxes and bars. */
.doc {
  display: grid;
  grid-template-columns: 34% 1fr;
  gap: 8px;
  width: 76%;
  margin-top: 14px;
  padding: 9px;
  border-radius: 8px;
  background: #1e293b;
  border: 1px solid var(--border-strong);
}

.doc--visa { grid-template-columns: 1fr 34%; }

.doc__photo {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  background: #334155;
  color: #64748b;
}

.doc__photo svg { width: 70%; }
.doc--visa .doc__photo { order: 2; }

.doc__lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}

.doc__lines i {
  height: 4px;
  border-radius: 2px;
  background: #475569;
}

.doc__lines i:nth-child(2) { width: 70%; }
.doc__lines i:nth-child(3) { width: 85%; }
.doc__lines--wide { grid-column: 1 / -1; order: 3; }

.mock-btn {
  display: grid;
  place-items: center;
  height: 46px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.mock-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary-text);
  font-weight: 600;
}

.mock-status svg { width: 20px; height: 20px; }
.mock-status--ok { color: #86efac; }
.mock-status--ok svg { color: var(--green); }

/* Scenes 2 and 3: a card like the popup's review card */
.mock-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.mock-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
}

.mock-title svg { width: 20px; height: 20px; color: var(--green); }

.mock-notice {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
  font-size: 13px;
}

.mock-portrait-row { display: flex; gap: 12px; }

.mock-portrait {
  display: grid;
  place-items: center;
  flex: none;
  width: 76px;
  border-radius: 8px;
  border: 2px solid #475569;
  background: #1e293b;
  color: #64748b;
}

.mock-portrait svg { width: 40px; height: 40px; }

.mock-fields {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.mock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.mock-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mock-field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.mock-field > b {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  font-weight: 500;
}

.mock-field i { font-style: normal; }

/* The web page behind the popup: a browser bar, then the Form C page. The page follows the
   layout of the government's page (navy head, blue strip and section bars, labels on the left,
   a help column on the right), drawn small because the camera shows the whole page at once. */
.gov {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #dcdce1;
}

/* Laid out larger and scaled down, so the type stays a sane size in CSS. */
.gov__page {
  --s: 0.8;
  width: calc(100% / var(--s));
  transform: scale(var(--s));
  transform-origin: 0 0;
  color: #1a1a1a;
  font: 12px/1.3 Arial, Helvetica, sans-serif;
}

.gov__bar .brand-mark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 10px;
}

.gov__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: #e8eaed;
  border-bottom: 1px solid #c4c7cc;
}

.gov__bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b6bac1;
}

.gov__url {
  flex: 1;
  margin-left: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  color: #3c4043;
  font: 12px/1.3 system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gov__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  /* The title sits in the left half: the popup covers the right half of the page's top. */
  padding: 12px 48% 12px 10px;
  background: linear-gradient(90deg, #3a2f9e, #0b1a7c 55%);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
}

.gov__head b { font-size: 19px; }
.gov__head span { font-size: 10px; font-weight: 700; }

.gov__nav {
  display: flex;
  gap: 22px;
  padding: 4px 10px;
  background: #5b8fe0;
  color: #fff;
  font: 10px/1.3 Georgia, "Times New Roman", serif;
}

.gov__nav span:first-child { margin-right: auto; }

/* Section bar and the two columns under it: the form on the left, help on the right. */
.gov__sec,
.gov__cols {
  display: grid;
  grid-template-columns: 62% 1fr;
}

.gov__sec {
  padding: 2px 4px;
  background: #1e6fe0;
  color: #fff;
  font-size: 11px;
}

.gov__rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
}

.gov__rows li {
  display: grid;
  grid-template-columns: 40% 1fr;
  align-items: center;
  gap: 5px;
  min-height: 20px;
}

.gov__rows li > span:first-child { text-align: right; white-space: nowrap; }
.gov__rows em { color: #d00000; font-style: normal; }
.gov__rows b { font-weight: 400; }

.gov__input {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 73%;
  height: 20px;
  padding: 0 4px;
  border: 1px solid #777;
  background: #eeeef2;
  white-space: nowrap;
  overflow: hidden;
}

.gov__input--short { width: 46%; }

/* A drop-down: it says "Select" until the script fills it. */
.gov__input--select::after {
  content: "";
  margin-left: auto;
  border: 4px solid transparent;
  border-top-color: #333;
  transform: translateY(2px);
}

.gov__input--select i { display: none; font-style: normal; }
.demo.is-live .gov__rows li:not(.is-on) .gov__input--select i { display: inline; }

/* Two buttons, one above the other, and the chosen photo beside them. */
.gov__file {
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  gap: 2px 6px;
}

.gov__file b { grid-area: 1 / 2 / 3 / 3; }

.gov__file i {
  padding: 1px 6px;
  border: 1px solid #777;
  background: #e6e6e6;
  font-style: normal;
  font-size: 11px;
  white-space: nowrap;
}

.gov__file b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 32px;
  border: 1px solid #777;
  background: #f4f4f6;
  color: #7b8496;
}

.gov__file svg { width: 20px; height: 20px; }

/* Help text, as plain bars: the wording is theirs, so it is not copied. */
.gov__help {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 8px;
}

.gov__help i {
  width: 80%;
  height: 4px;
  border-radius: 2px;
  background: #3b6fd1;
  opacity: 0.55;
}

.gov__help i:nth-child(2n) { width: 55%; }
.gov__help i:nth-child(3n) { width: 68%; }

/* The page's own buttons: the visitor presses them, the extension never does. */
.gov__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px;
}

.gov__actions span {
  padding: 3px 8px;
  border: 1px solid #555;
  background: #e2e2e2;
  font: 12px/1.3 Georgia, "Times New Roman", serif;
}

.gov__foot { height: 14px; background: #1e6fe0; }

/* A field flashes once as it is filled. */
.demo.is-live .gov__rows li.is-on :is(.gov__input, .gov__file b) { animation: gov-fill 900ms ease-out; }

@keyframes gov-fill {
  from { background: #fff3b0; }
}

/* The extension's message at the end of step 3, over the bottom of the page. */
.world__toast {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

/* In step 3 the popup's review values just stay as they were. */
.demo.is-live[data-step="3"] .scene--review .pop {
  opacity: 1;
  transform: none;
  transition: none;
}

/* While the script plays a step (.is-live), each .pop part waits hidden, then pops in when the
   script adds .is-on. Without the script every part simply shows. */
.demo.is-live .pop {
  opacity: 0;
  transform: scale(0.9) translateY(4px);
}

.demo.is-live .pop.is-on {
  opacity: 1;
  transform: none;
  transition: opacity 200ms ease-out, transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.mock-status:not(.mock-status--ok) svg { animation: spin 1s linear infinite; }
/* A step the visitor chose stops moving once it has played. */
.demo.is-held .mock-status svg { animation: none; }

.mock-btn,
.tile,
.mock-field > b { transition: transform 150ms ease, filter 150ms ease, background 250ms ease, border-color 200ms ease, box-shadow 200ms ease; }

/* Extract waits for both photos. */
.mock-btn.is-off {
  background: rgba(37, 99, 235, 0.35);
  color: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.is-pressed {
  transform: scale(0.96);
  filter: brightness(1.2);
}

.mock-field > b.is-focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* The pointer. The script moves it; its tip (top left) is the click point. */
.demo__cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: none;
  width: 22px;
  height: 22px;
  opacity: 0;
  pointer-events: none;
  transition: transform 550ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
}

.demo.is-live .demo__cursor { display: block; }
.demo__cursor.is-on { opacity: 1; }

.demo__cursor svg {
  display: block;
  width: 22px;
  height: 22px;
  transform-origin: 0 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.demo__cursor::after {
  content: "";
  position: absolute;
  top: -15px;
  left: -15px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #60a5fa;
  opacity: 0;
}

.demo__cursor.is-click svg { animation: cursor-tap 260ms ease; }
.demo__cursor.is-click::after { animation: cursor-ring 480ms ease-out; }

@keyframes cursor-tap {
  50% { transform: scale(0.78); }
}

@keyframes cursor-ring {
  from { opacity: 0.9; transform: scale(0.3); }
  to { opacity: 0; transform: scale(1.5); }
}

/* Step buttons under the popup, with back and next arrows. The current step is lit. */
.demo__bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.demo__steps {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0;
  list-style: none;
}

.demo__steps button {
  position: relative;
  width: 100%;
  min-height: 44px;
  padding: 8px 0 0;
  border: 0;
  border-top: 3px solid var(--border-strong);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
}

.demo__steps button:disabled { cursor: default; }
.demo__steps button:enabled:hover { color: var(--text); }

.demo[data-step="1"] .demo__steps li:nth-child(1) button,
.demo[data-step="2"] .demo__steps li:nth-child(2) button,
.demo[data-step="3"] .demo__steps li:nth-child(3) button {
  border-color: #3b82f6;
  color: var(--text);
}

/* While the demo plays by itself, the current step's line fills up as the step runs. */
.demo.is-auto[data-step] .demo__steps li:nth-child(n) button { border-top-color: var(--border-strong); }

.demo.is-auto .demo__steps button[aria-current]::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background: #3b82f6;
  transform-origin: 0 0;
  animation: demo-progress var(--step-ms, 4s) linear both;
}

@keyframes demo-progress {
  from { transform: scaleX(0); }
}

.demo__nav {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.demo__nav[hidden] { display: none; }
.demo__nav:hover { background: var(--primary-soft); color: #fff; transform: translateY(-1px); }
.demo__nav svg { width: 20px; height: 20px; }

/* ── Sections ── */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section--alt { background: var(--sidebar); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
  margin-bottom: 36px;
}

.section h2 {
  font-size: clamp(26px, 3.4vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lead {
  font-size: 17px;
  color: var(--text-3);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform 150ms ease, border-color 150ms ease;
}

.card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.card h3 { font-size: 20px; font-weight: 800; }
.card p { color: var(--text-2); }

.icon-tile {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 800;
}

.icon-tile svg { width: 24px; height: 24px; }

.section-more { margin-top: 28px; }

/* Who it's for: three small tiles, then what helps them. */
.audience {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 0;
  list-style: none;
}

.audience li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 10px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 17px;
  font-weight: 700;
}

/* Fades in when scrolled to. The script hides only what starts below the screen. */
.reveal { transition: opacity 400ms ease-out, transform 400ms ease-out; }
.reveal.is-hidden { opacity: 0; transform: translateY(12px); }

/* ── Pricing (same look as the extension's Subscription tab) ── */
.plans {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.plans-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.plans-head__text {
  display: flex;
  flex: 1 1 360px;
  flex-direction: column;
  gap: 12px;
}

.plans h3 { font-size: 24px; font-weight: 800; }

.plan-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-toggle {
  display: flex;
  flex-wrap: wrap;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.billing-toggle button {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.billing-toggle button[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.billing-toggle .chip { padding: 2px 10px; font-size: 13px; font-weight: 700; }

.billing-toggle button[aria-pressed="true"] .chip {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.plan-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-group h4 { font-size: 18px; font-weight: 700; color: var(--text-2); }
/* With the switch on, its buttons name the group, so the group heading is for screen readers only. */
.has-switch .plan-group h4 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.pricing-card { gap: 20px; }

.pricing-card__name {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tier-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--tier-soft);
  color: var(--tier);
}

.tier-icon svg { width: 24px; height: 24px; }

.pricing-plan-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--tier, var(--text));
}

.pricing-cost {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.pricing-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.pricing-price span {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-3);
}

.pricing-uses {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.pricing-uses strong { font-size: 22px; font-weight: 800; }

.pricing-uses small {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-3);
}

.pricing-uses__bonus {
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--tier-soft);
  color: var(--tier);
  font-size: 14px;
  font-weight: 600;
}

.free-row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 20px 28px;
}

.free-row h3 { font-size: 20px; }

.plans-divider {
  margin-top: 16px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.fine-print {
  font-size: 15px;
  color: var(--text-3);
}

/* ── FAQ ── */
.faq {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 800px;
}

.faq details {
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 14px 22px;
  border-radius: 16px;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  flex: none;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  color: var(--primary-text);
  transition: transform 150ms ease;
}

.faq details[open] summary::after { transform: rotate(45deg); }
.faq h3 { font-size: 17px; font-weight: 700; }

.faq details p {
  padding: 0 22px 20px;
  color: var(--text-2);
}

/* ── Footer ── */
.site-footer {
  padding: 48px 0 32px;
  background: var(--sidebar);
  border-top: 1px solid var(--border);
  font-size: 15px;
  color: var(--text-3);
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
}

.site-footer .brand { margin-bottom: 12px; }

.footer-title {
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.footer-links { padding: 0; list-style: none; }

.footer-links a,
.footer-mail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.footer-links a { color: var(--text-2); }

.footer-links a:hover,
.footer-mail:hover { text-decoration: underline; }

.footer-note {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}

/* ── Legal and policy pages (same shell as the extension's assets/legal.css) ── */
.legal-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.legal-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.legal-back,
.legal-switch {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease;
}

.legal-back:hover,
.legal-switch:hover {
  color: #fff;
  border-color: rgba(96, 165, 250, 0.5);
  background: var(--primary-soft);
}

.legal-content {
  flex: 1;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
  animation: legal-fade-in 300ms ease-out;
}

@keyframes legal-fade-in {
  from { opacity: 0; transform: translateY(6px); }
}

.legal-byline {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-text);
}

.legal-title {
  margin-bottom: 8px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.legal-effective {
  margin-bottom: 32px;
  color: var(--text-3);
}

.legal-body {
  padding: 8px 36px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-2);
}

.legal-body section { padding-top: 24px; }

.legal-body section + section {
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.legal-body h2 {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.legal-body p { margin-bottom: 14px; }

.legal-body ul,
.legal-body ol {
  margin-bottom: 14px;
  padding-left: 24px;
}

.legal-body li { margin-bottom: 8px; }
.legal-body li::marker { color: var(--link); }

.legal-body strong {
  font-weight: 600;
  color: var(--text);
}

.legal-body a { text-decoration: none; }
.legal-body a:hover { text-decoration: underline; }

/* ── Smaller screens ── */
@media (max-width: 880px) {
  html { scroll-padding-top: 16px; }

  .site-header { position: static; }

  .site-header .wrap {
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: -14px;
  }

  .hero { padding: 40px 0 64px; }

  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .section { padding: 56px 0; }

  .grid-3,
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .site-header .btn { display: none; } /* the same button is in the hero just below */
  .world__toast { padding: 10px; font-size: 13px; } /* one line, clear of the page's buttons */
  .hero-lead { font-size: 17px; }
  .card { padding: 22px; }
  .billing-toggle button { padding: 0 12px; }
  .legal-topbar { padding: 12px 16px; }
  .legal-content { padding: 32px 16px; }
  .legal-title { font-size: 28px; }
  .legal-body { padding: 4px 20px 18px; }
}

/* No movement for people who ask for less motion; the popup stays on its review step. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
