/* ============================================================================
   hs-a11y.css — the accessibility layer that belongs to every page.

   Two things live here and nothing else: the skip link, and a focus indicator
   that cannot be silently removed by a page's own stylesheet.

   ON SPECIFICITY, because it is the whole trick.
   The pages that failed the audit did not forget to style focus; they set
   `outline: none` on a class and never replaced it. A rule like `.cta` has
   specificity 0,1,0. A rule like `button:focus-visible` has 0,1,1 — a
   pseudo-class counts at class weight — so it wins without a single
   !important. The named overrides further down exist for the three cases where
   the page rule was more specific than that.

   ON BRAND. The indicator is the brand gold on a two-pixel dark halo. It reads
   on the near-black ground the whole platform uses and on the gold buttons,
   which a single-colour ring cannot do. Nothing here changes a resting state:
   this is only ever visible to somebody navigating by keyboard.
   ============================================================================ */

:root {
  --hs-focus: #E8C878;
  --hs-focus-halo: #0b0910;
}

/* ── skip link ──────────────────────────────────────────────────────────────
   Off-screen until focused, which is the first thing a keyboard user reaches. */
.hs-skip {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  left: 12px; top: 0;
  z-index: 2147483001;
  padding: 0; border: 0;
  background: #E8C878;
  color: #241a05;
  font: 600 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  text-decoration: none;
  border-radius: 0 0 12px 12px;
}
.hs-skip:focus,
.hs-skip:focus-visible {
  width: auto; height: auto;
  overflow: visible;
  clip: auto;
  padding: 12px 20px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5);
  outline: 3px solid #0b0910;
  outline-offset: -3px;
}

/* ── links inside body copy ─────────────────────────────────────────────────
   1.4.1 does not allow colour to be the only thing marking a link. The footers
   here use gold on near-black at 12:1, which is beautiful and is still colour
   alone. Underlined, with the offset set so descenders survive. */
.hs-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.hs-link:hover { text-decoration-thickness: 2px; }

/* ── focus indicator ───────────────────────────────────────────────────────
   :focus-visible, not :focus, so a mouse click never draws a ring. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[contenteditable]:focus-visible {
  outline: 3px solid var(--hs-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--hs-focus-halo);
  border-radius: 4px;
}

/* The three the audit caught, where the page rule outranked the rule above. */
.chip:focus-visible,
.cmp-chip:focus-visible,
.cta:focus-visible,
button.chip:focus-visible,
button.cmp-chip:focus-visible,
a.cta:focus-visible,
button.cta:focus-visible {
  outline: 3px solid var(--hs-focus) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px var(--hs-focus-halo) !important;
}

/* Windows High Contrast: system colours replace ours, and an outline that is
   only a box-shadow disappears entirely there. */
@media (forced-colors: active) {
  a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
  textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible,
  [role="button"]:focus-visible {
    outline: 3px solid Highlight;
    box-shadow: none;
  }
}

/* ── announcements ─────────────────────────────────────────────────────────
   A live region has to be in the document and non-empty-able. Visually hidden,
   never display:none — a hidden element is not announced. */
.hs-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ── reflow at 400% zoom ───────────────────────────────────────────────────
   WCAG 1.4.10 asks that content reflow into a 320 CSS pixel viewport without a
   horizontal scrollbar. Three measured offenders, and nothing else:

     · .plan  — pricing cards rendered 350px wide at a 320px viewport, because
                38px of side padding sits inside a grid track that will not
                shrink below its content.
     · .btn   — white-space:nowrap kept the gold buttons 297px wide inside a
                321px card.
     · .why / .li — flex children default to min-width:auto, so they refuse to
                shrink below their content.

   This block only exists below 420px, which is a zoomed phone. Nothing about
   the design at any normal size changes. */
@media (max-width: 420px) {
  .plan, .why, .li, .btn, .stat, .beat, .grid, .grid > * { min-width: 0; }
  .plan { padding-left: 20px; padding-right: 20px; }
  .btn, .per, .price { white-space: normal; }
  .why, .why *, .plan *, .li, .li * { max-width: 100%; overflow-wrap: break-word; }
  img, video, canvas, table, pre { max-width: 100%; }
}

/* The homepage pricing card still ran 15px past a 320px viewport: the price row
   is a flex line whose figure and unit will not wrap. Below 360px the card
   gives up more padding and the row is allowed to break. */
@media (max-width: 360px) {
  .plan { padding-left: 14px; padding-right: 14px; }
  /* .amount is a flex row — $ · 39.95 · /month — and flex lines do not wrap
     by default, so the unit pushed 15px past the viewport. */
  .plan .amount, .plan .price, .plan .price-row { flex-wrap: wrap; }
  .plan .v { font-size: clamp(28px, 11vw, 44px); }
}

/* ── reduced motion ────────────────────────────────────────────────────────
   The decks already answer this question in about fifty places of their own.
   What they did not cover is the scroll-reveal on the marketing pages: .rv
   elements start at opacity 0 and animate in, so somebody who has asked their
   operating system for less motion still gets a page that moves as they read.
   Braked here rather than globally — a blanket `*` rule would reach inside the
   deck's own animation machinery, which listens for animationend. */
@media (prefers-reduced-motion: reduce) {
  .hs-skip { transition: none; }
  .rv, [class*="rv-"], .kb, .kb-strong {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  html { scroll-behavior: auto !important; }
}

/* ── 2.5.8 Target Size (Minimum) ────────────────────────────────────────────
   New at AA in WCAG 2.2: a target must be at least 24 x 24 CSS pixels unless
   it sits inline within a sentence, where the line height of the surrounding
   text constrains it. Footer columns, back links and disclosure summaries are
   standalone controls, not inline text, and measured 20-23px tall — one to four
   pixels short.

   This adds hit area, not height you can see: the links already occupy that
   space visually through their line box. Nothing moves. */
footer a:not(.hs-link),
nav a,
.back,
summary,
.foot a:not(.hs-link) {
  display: inline-block;
  min-height: 24px;
  padding-block: 2px;
}
