/* ─────────────────────────────────────────────────────────────
     TOKENS
     The palette is the heatmap's own thermal ramp. Neutrals are
     biased warm toward the ember accent rather than pure grey.
     ───────────────────────────────────────────────────────────── */
  :root {
    --cool:   #2F6FB2;
    --mid:    #3E9A78;
    --amber:  #F0B429;
    --warm:   #EF7B34;
    --hot:    #D93A1E;

    --ground:  #F7F6F4;
    --surface: #FFFFFF;
    --sunk:    #EFEDE9;
    --ink:     #191614;
    --muted:   #6B645E;
    --hairline:#DDD9D3;

    --accent:  #C4331A;
    --accent-ink: #FFFFFF;

    --display: "Helvetica Neue", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --body: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --measure: 66ch;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --rule: 1px solid var(--hairline);
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --ground:  #14110F;
      --surface: #1C1815;
      --sunk:    #221D19;
      --ink:     #F2EFEC;
      --muted:   #A39B94;
      --hairline:#332C27;
      --accent:  #FF6242;
      --accent-ink: #1A0D09;
      --cool: #4E8FD4;
      --mid:  #4FB98F;
    }
  }
  /* The viewer's toggle must win over the OS preference, both ways. */
  :root[data-theme="dark"] {
    --ground:  #14110F;
    --surface: #1C1815;
    --sunk:    #221D19;
    --ink:     #F2EFEC;
    --muted:   #A39B94;
    --hairline:#332C27;
    --accent:  #FF6242;
    --accent-ink: #1A0D09;
    --cool: #4E8FD4;
    --mid:  #4FB98F;
  }
  :root[data-theme="light"] {
    --ground:  #F7F6F4;
    --surface: #FFFFFF;
    --sunk:    #EFEDE9;
    --ink:     #191614;
    --muted:   #6B645E;
    --hairline:#DDD9D3;
    --accent:  #C4331A;
    --accent-ink: #FFFFFF;
    --cool: #2F6FB2;
    --mid:  #3E9A78;
  }

  /* ── base ── */
  * { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  }

  body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font-family: var(--body);
    font-size: clamp(1rem, .96rem + .2vw, 1.125rem);
    line-height: 1.65;
    overflow-x: hidden;
  }

  h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 800;
    letter-spacing: -0.028em;
    text-wrap: balance;
    margin: 0;
    line-height: 1.05;
  }
  h1 { font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5.25rem); }
  h2 { font-size: clamp(1.9rem, 1.35rem + 2.3vw, 3.1rem); }
  h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.45rem); letter-spacing: -0.018em; }
  p { margin: 0; }
  a { color: inherit; }

  .wrap { max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }
  .prose { max-width: var(--measure); }

  /* Mono spec label — the recurring datasheet device. */
  .eyebrow {
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 0;
  }
  .eyebrow::before {
    content: "";
    width: 1.6rem; height: 3px; border-radius: 2px;
    background: linear-gradient(90deg, var(--cool), var(--mid), var(--amber), var(--warm), var(--hot));
    flex: none;
  }

  section { border-top: var(--rule); }
  .pad { padding-block: clamp(3.5rem, 8vw, 7rem); }

  :is(a, button, summary, input):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
  }

  /* ── nav ── */
  header.bar {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--ground) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: var(--rule);
  }
  .bar-in {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding-block: .85rem;
  }
  .wordmark {
    font-family: var(--display); font-weight: 800; letter-spacing: -0.04em;
    font-size: 1.2rem; text-decoration: none; display: flex; align-items: center; gap: .55rem;
  }
  /* The mark is the product's own thermal ramp — a heatmap hotspot. Inlined
     rather than <img> so the wordmark beside it can use currentColor and the
     whole lockup follows the surrounding text colour. */
  .spark { width: 18px; height: 18px; flex: none; display: block; }
  .bar nav { display: flex; gap: clamp(.9rem, 2.2vw, 1.9rem); align-items: center; }
  .bar nav a {
    font-family: var(--mono); font-size: .74rem; letter-spacing: .1em;
    text-transform: uppercase; text-decoration: none; color: var(--muted);
  }
  .bar nav a:hover { color: var(--ink); }
  @media (max-width: 620px) { .bar nav a.hide-sm { display: none; } }

  /* ── hero ── */
  .hero { padding-top: clamp(2.5rem, 6vw, 5rem); padding-bottom: clamp(2rem, 4vw, 3rem); border-top: 0; }
  .hero h1 { margin-top: 1.4rem; max-width: 16ch; }
  .hero h1 em { font-style: normal; color: var(--accent); }
  .lede {
    margin-top: 1.5rem; max-width: 54ch;
    font-size: clamp(1.06rem, 1rem + .38vw, 1.32rem);
    color: var(--muted);
  }

  .cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; align-items: center; }
  .btn {
    font-family: var(--display); font-weight: 700; font-size: .95rem;
    letter-spacing: -0.01em;
    padding: .78rem 1.5rem; border-radius: 3px; text-decoration: none;
    display: inline-block; border: 1px solid transparent; cursor: pointer;
    transition: transform .12s ease, background .16s ease;
  }
  .btn-primary { background: var(--accent); color: var(--accent-ink); }
  .btn-primary:hover { transform: translateY(-1px); }
  .btn-ghost { border-color: var(--hairline); color: var(--ink); background: transparent; }
  .btn-ghost:hover { border-color: var(--ink); }
  .cta-note { font-family: var(--mono); font-size: .74rem; color: var(--muted); }

  /* ── the live demo: the page's thesis ── */
  .stage-shell { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
  .stage {
    position: relative; border: var(--rule); border-radius: 4px;
    background: var(--surface); overflow: hidden;
    aspect-ratio: 16 / 9; min-height: 300px;
    cursor: crosshair;
    touch-action: pan-y;
  }
  /* Mock page behind the overlay — abstract, never a fake screenshot. */
  .mock { position: absolute; inset: 0; padding: clamp(1rem, 3vw, 2.2rem); display: flex; flex-direction: column; gap: clamp(.7rem, 1.6vw, 1.3rem); user-select: none; }
  .mock-bar { display: flex; align-items: center; gap: .6rem; padding-bottom: clamp(.6rem,1.5vw,1rem); border-bottom: var(--rule); }
  .mock-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hairline); }
  .mock-nav { margin-left: auto; display: flex; gap: .5rem; }
  .mock-nav span { display: block; width: clamp(28px, 5vw, 46px); height: 7px; border-radius: 2px; background: var(--hairline); }
  .mock-h { width: min(62%, 380px); height: clamp(16px, 3.4vw, 30px); border-radius: 3px; background: var(--hairline); }
  .mock-l { height: 8px; border-radius: 2px; background: var(--sunk); }
  .mock-btn {
    width: clamp(96px, 17vw, 150px); height: clamp(28px, 4.6vw, 40px);
    border-radius: 3px; background: var(--accent); opacity: .82; margin-top: .3rem;
  }
  .mock-grid { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.5rem, 1.4vw, 1rem); }
  .mock-card { height: clamp(46px, 9vw, 86px); border-radius: 3px; background: var(--sunk); border: var(--rule); }
  #paint { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

  .stage-hint {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    font-family: var(--mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--ink); background: color-mix(in srgb, var(--surface) 82%, transparent);
    border: var(--rule); border-radius: 3px; padding: .55rem 1rem; pointer-events: none;
    transition: opacity .5s ease;
  }
  .stage.touched .stage-hint { opacity: 0; }

  .stage-meta {
    display: flex; flex-wrap: wrap; gap: 1rem 1.75rem; align-items: center;
    margin-top: .9rem;
  }
  .legend { display: flex; align-items: center; gap: .55rem; font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .ramp { width: 128px; height: 7px; border-radius: 4px;
    background: linear-gradient(90deg, var(--cool), var(--mid), var(--amber), var(--warm), var(--hot)); }
  .stage-note { font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-left: auto; }
  .stage-note b { color: var(--ink); font-weight: 500; }
  @media (max-width: 700px) { .stage-note { margin-left: 0; } }

  /* ── data-flow diagram: the honest differentiator ── */
  .flow { display: grid; gap: clamp(1rem, 3vw, 2rem); grid-template-columns: 1fr 1fr; margin-top: 2.5rem; }
  @media (max-width: 760px) { .flow { grid-template-columns: 1fr; } }
  .flow-card { border: var(--rule); border-radius: 4px; padding: clamp(1.1rem, 2.6vw, 1.8rem); background: var(--surface); }
  .flow-card h3 { margin-bottom: .9rem; }
  .flow-card.them { border-style: dashed; }
  .flow-tag { font-family: var(--mono); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: .8rem; }
  .hop { display: flex; align-items: center; gap: .6rem; font-family: var(--mono); font-size: .76rem; flex-wrap: wrap; }
  .node { border: var(--rule); border-radius: 3px; padding: .42rem .7rem; background: var(--sunk); white-space: nowrap; }
  .node.self { border-color: var(--accent); color: var(--accent); }
  .arrow { color: var(--muted); }
  .flow-card p { margin-top: 1rem; color: var(--muted); font-size: .95rem; }

  /* ── product shots ── */
  .shot { margin: clamp(2rem, 4vw, 3rem) 0 0; }
  .shot img {
    display: block; width: 100%; height: auto;
    border: var(--rule); border-radius: 4px; background: var(--surface);
  }
  .shot figcaption {
    margin-top: .85rem; font-size: .92rem; color: var(--muted);
    max-width: var(--measure);
  }
  .shot figcaption strong { color: var(--ink); font-weight: 600; }

  /* ── features ── */
  .feat { display: grid; gap: clamp(1.6rem, 3.4vw, 2.6rem); grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); margin-top: 3rem; }
  .feat-item { display: flex; flex-direction: column; gap: .55rem; }
  .feat-item .num { font-family: var(--mono); font-size: .7rem; color: var(--muted); letter-spacing: .1em; }
  .feat-item p { color: var(--muted); font-size: .95rem; }

  /* ── pricing ── */
  .tiers { display: grid; gap: clamp(1rem, 2.6vw, 1.75rem); grid-template-columns: 1fr 1fr; margin-top: 2.8rem; align-items: start; }
  @media (max-width: 760px) { .tiers { grid-template-columns: 1fr; } }
  .tier { border: var(--rule); border-radius: 4px; padding: clamp(1.4rem, 3vw, 2.1rem); background: var(--surface); position: relative; }
  .tier.pro { border-color: var(--accent); }
  .tier.pro::before {
    content: ""; position: absolute; inset-inline: -1px; top: -1px; height: 3px;
    background: linear-gradient(90deg, var(--cool), var(--mid), var(--amber), var(--warm), var(--hot));
    border-radius: 4px 4px 0 0;
  }
  .tier-name { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .price { font-family: var(--display); font-weight: 800; letter-spacing: -0.04em; font-size: clamp(2.6rem, 2rem + 2vw, 3.4rem); line-height: 1; margin-top: .7rem; font-variant-numeric: tabular-nums; }
  .price span { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
  .tier ul { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; font-size: .95rem; }
  .tier li { display: flex; gap: .65rem; align-items: baseline; }
  .tier li::before { content: "—"; color: var(--accent); font-family: var(--mono); font-size: .8rem; flex: none; }
  .tier .btn { margin-top: 1.75rem; width: 100%; text-align: center; }
  .tier-fine { font-family: var(--mono); font-size: .7rem; color: var(--muted); margin-top: .9rem; text-align: center; }

  /* ── compliance ── */
  .disclaim {
    border: var(--rule); border-left: 3px solid var(--amber);
    border-radius: 3px; padding: clamp(1rem, 2.4vw, 1.5rem);
    background: var(--surface); margin-top: 2rem;
    font-size: .92rem; color: var(--muted);
  }
  .disclaim strong { color: var(--ink); }

  /* ── faq / policies ── */
  details {
    border-bottom: var(--rule); padding: 1.15rem 0;
  }
  summary {
    cursor: pointer; font-family: var(--display); font-weight: 700;
    font-size: 1.03rem; letter-spacing: -0.012em; list-style: none;
    display: flex; gap: 1rem; align-items: baseline;
  }
  summary::-webkit-details-marker { display: none; }
  summary::after { content: "+"; margin-left: auto; font-family: var(--mono); color: var(--muted); font-weight: 400; }
  details[open] summary::after { content: "–"; }
  details > div { padding-top: .85rem; max-width: var(--measure); color: var(--muted); font-size: .95rem; display: flex; flex-direction: column; gap: .8rem; }
  details a { color: var(--accent); }

  .policy { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 2.5rem; }
  .policy h3 { margin-bottom: .8rem; }
  .policy p, .policy li { color: var(--muted); font-size: .95rem; }
  .policy ul { margin: .7rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .4rem; }
  .policy .prose > p + p { margin-top: .8rem; }

  /* ── footer ── */
  footer { border-top: var(--rule); padding-block: 3rem 4rem; }
  .foot-grid { display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start; }
  .foot-meta { font-family: var(--mono); font-size: .75rem; color: var(--muted); display: flex; flex-direction: column; gap: .4rem; }
  .foot-meta a { color: var(--accent); }
  .foot-links { display: flex; flex-wrap: wrap; gap: 1.2rem; font-family: var(--mono); font-size: .75rem; }
  .foot-links a { color: var(--muted); text-decoration: none; }
  .foot-links a:hover { color: var(--ink); }

  /* ─────────────────────────────────────────────────────────────
     ACCESSIBILITY
     WCAG 2.4.7 Focus Visible (AA): every interactive element needs a
     focus indicator a keyboard user can actually see — none of the 23
     focusable elements on this page had one. :focus-visible keeps it
     off mouse clicks and on for keyboard/AT navigation.
     WCAG 2.4.1 Bypass Blocks (A): the skip link lets a screen-reader or
     keyboard user jump the nav straight to the content.
     ───────────────────────────────────────────────────────────── */
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  summary:focus-visible,
  [tabindex]:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 3px;
    border-radius: 3px;
  }

  /* Older engines without :focus-visible still get a visible ring. */
  @supports not selector(:focus-visible) {
    a:focus, button:focus, input:focus, select:focus, textarea:focus {
      outline: 3px solid var(--amber);
      outline-offset: 3px;
    }
  }

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: 0.75rem 1.25rem;
    background: var(--hot);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 6px 0;
  }
  .skip-link:focus {
    left: 0;
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

/* ─────────────────────────────────────────────────────────────
   LEGAL PAGES
   Terms, Privacy and Refunds each live at their own URL now, so
   they need their own typography — previously they inherited it
   from the landing page's section wrappers. Long-form prose, so:
   a measure that stays readable, real spacing between clauses,
   and headings that separate sections without shouting.
   ───────────────────────────────────────────────────────────── */
.legal {
  max-width: 68ch;
  margin-top: 1.6rem;
}
.legal p {
  margin: 0 0 1.15rem;
  color: var(--muted);
}
.legal p strong {
  color: var(--ink);
  font-weight: 600;
}
.legal h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 2.4rem 0 .9rem;
  color: var(--ink);
}
.legal > div + div {
  margin-top: 3rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--hairline);
}
.legal a { color: var(--accent); }

/* The eyebrow doubles as a breadcrumb on these pages. */
.eyebrow a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.legal h1 {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  color: var(--ink);
}

.legal h2 {
  font-family: var(--display);
  font-size: 1.15rem;
  margin: 2.6rem 0 1rem;
  color: var(--ink);
}

/* ─────────────────────────────────────────────────────────────
   WCAG 1.4.10 Reflow (AA)
   At a 320px viewport the page required horizontal scrolling: the
   hero stage combines aspect-ratio 16/9 with min-height 300px, and
   that pins its width to 300 x 16/9 = 533px regardless of the
   container. Below the phone breakpoint, let the container drive
   the width and take a taller ratio instead.
   ───────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .stage {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  /* The top bar runs out of room once the wordmark and the three
     surviving nav links are side by side; let it wrap rather than
     push the document wider than the viewport. */
  .bar-in {
    flex-wrap: wrap;
    row-gap: .5rem;
  }
  .bar nav {
    gap: clamp(.7rem, 4vw, 1.2rem);
  }
}
