/* Polish: four small effects, ported to plain CSS and JS from ideas in Magic UI (MIT):
   blur fade on scroll reveals, a border beam on the featured price card, a number ticker, a reading progress bar.
   Loaded last. Every effect has a reduced-motion fallback and works with scripting off. */

/* ---------- Blur fade: the existing reveal also eases out of a soft blur ---------- */
.js .reveal { filter: blur(6px); transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.in { filter: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { filter: none; transition: none; } }

/* ---------- Border beam: a soft light travels once round the featured price card ---------- */
@property --beam-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.price.featured::after {
  content: ""; position: absolute; inset: -2px; padding: 2px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--beam-angle), transparent 0deg, transparent 200deg, color-mix(in srgb, var(--accent-strong, var(--blue)) 30%, #fff) 320deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: beam-spin 7s linear infinite;
}
@keyframes beam-spin { to { --beam-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) { .price.featured::after { display: none; } }

/* ---------- Number ticker: figures count up once when they scroll into view ---------- */
[data-ticker] { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Reading progress on articles ---------- */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; background: var(--accent, var(--blue)); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }

/* ---------- Scroll-synced showcase (HMS page): text steps scroll, one screen stays and changes with them ---------- */
.stackshow { display: block; }
.ss-step { padding: 28px 0 28px 20px; border-left: 2px solid var(--line); margin-bottom: 40px; }
.ss-step.is-active { border-left-color: var(--accent-strong, var(--blue)); }
.ss-step h2 { margin-bottom: 14px; }
.ss-step p { color: var(--ink-2); font-size: 19px; }
.ss-step .checks { margin: 18px 0 0; padding: 0; list-style: none; }
.ss-step .checks li { padding: 8px 0 8px 28px; position: relative; color: var(--ink-2); }
.ss-step .checks li::before { content: ""; position: absolute; left: 0; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-strong, var(--blue)); }
.ss-inline { margin: 24px 0 0; }
.ss-inline img { width: 100%; height: auto; }
.ss-stage { display: none; }
@media (min-width: 981px) {
  .js .stackshow { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
  .js .ss-step { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; margin-bottom: 0; }
  .js .ss-inline { display: none; }
  .js .ss-stage { display: block; position: sticky; top: 110px; }
  .ss-stage .frame { position: relative; aspect-ratio: 1800 / 1012; }
  .ss-stage .frame img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.45s ease; }
  .ss-stage .frame img.on { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .ss-stage .frame img { transition: none; } }

/* ---------- Module tabs (HMS page): three groups, one grid of module cards each ---------- */
.mod-tabs { display: none; }
.js .mod-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 28px; border: 1px solid var(--line); border-radius: 980px; background: var(--card); flex-wrap: wrap; }
.mod-tab { min-height: 44px; padding: 0 20px; border: 0; border-radius: 980px; background: transparent; color: var(--ink-2); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; transition: background 0.2s, color 0.2s; }
.mod-tab:hover { color: var(--ink); }
.mod-tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.mod-group { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 0 0 14px; }
.js .mod-group { display: none; }
.mod-panel + .mod-panel { margin-top: 36px; }
.js .mod-panel + .mod-panel { margin-top: 0; }
.mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mod { display: flex; gap: 16px; align-items: flex-start; padding: 24px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.mod-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--hms) 12%, transparent); color: var(--hms-t); }
.mod-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mod h3 { font-size: 19px; margin-bottom: 6px; letter-spacing: -0.01em; }
.mod p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
@media (min-width: 981px) { .mod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mod-grid { grid-template-columns: minmax(0, 1fr); } .mod-tab { padding: 0 14px; } }

/* ---------- HMS plans: four cards and a comparison table ---------- */
.price-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.price .addons { font-size: 14px; color: var(--ink-2); margin: 0 0 20px; }
.cmp-wrap { margin-top: 40px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.cmp { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
.cmp caption { text-align: left; padding: 18px 20px 6px; font-weight: 600; font-size: 17px; }
.cmp th, .cmp td { padding: 10px 16px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.cmp thead th { font-weight: 600; background: var(--bg-alt); }
.cmp tbody th[scope="row"] { font-weight: 400; }
.cmp .grp th { background: var(--bg-alt); font-weight: 600; color: var(--ink); }
.cmp td { color: var(--ink-2); }
.cmp td.yes { color: var(--hms-t); font-weight: 700; }
.cmp-wrap:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
@media (max-width: 1180px) { .price-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; } }
@media (max-width: 720px) { .price-grid-4 { grid-template-columns: minmax(0, 1fr); } }
.price-grid-4 .amt { font-size: 32px; white-space: nowrap; }

/* HMS plans, tidier: aligned card heads, one note instead of repeated lines, compact table */
.price-grid-4 { align-items: stretch; }
.price-grid-4 .plan-for { min-height: 2.8em; margin-bottom: 4px; }
.price-grid-4 .amt { font-size: 30px; margin: 10px 0 16px; }
.price-grid-4 ul { margin: 0 0 18px; }
.price-grid-4 li { padding: 8px 0; font-size: 15px; }
.price-grid-4 li.inc { font-weight: 600; color: var(--ink); }
.price-grid-4 .addons { margin: 0 0 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.plan-note { margin: 18px 0 0; max-width: 78ch; color: var(--ink-2); font-size: 15px; }
.plan-head > div { flex: 1 1 360px; min-width: 0; }
.cmp { font-size: 14.5px; }
.cmp th, .cmp td { padding: 8px 14px; }
.cmp td, .cmp thead th:not(:first-child) { text-align: center; }
.cmp tbody th[scope="row"] { width: 34%; }
.cmp-wrap { overflow-x: auto; }
.price-grid-4 .plan-for { min-height: 0; margin-bottom: 18px; }

/* Products menu: four products, own-site links marked, a small foot line */
.dd-products { min-width: 300px; }
.dd-products .ext { font-weight: 400; font-size: 0.85em; color: var(--ink-3); }
.dd-foot { margin-top: 6px; padding: 10px 14px 6px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.dd-foot a { padding: 0 !important; font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.dd-foot a:hover { background: none !important; }
.dd-foot small { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 820px) { .dd-foot { padding: 12px 0 8px; border-top: 0; } .nav-links .dd-foot a { font-size: 16px; font-weight: 500; border-bottom: 0; padding: 4px 0 !important; } }
