/* Bruncsoft link system — ONE definition of what a link looks like, for every page.
 *
 * WHY THIS EXISTS: there was no baseline `a` rule anywhere in the site. Every context that
 * happened to have a link got its own hand-written rule (`.pi-links a`, `.svc-card a`,
 * `.details-content a`, `.price-list a`, `.products-note a`, `.modal a`, plus five copies of
 * the same `style="color:var(--accent);text-decoration:none;font-weight:500"` typed inline).
 * Anywhere nobody had written one, the link fell back to the BROWSER DEFAULT: #0000EE,
 * underlined — which on the dark theme is dark blue on near-black and is barely readable.
 * services.html line ~125 and uzemko.html were both doing exactly that.
 *
 * So this file is to links what bs-chrome.js is to the nav: the single place. Load it AFTER
 * form-ui.css / bf-site.css. Everything here is either a bare element selector (weakest
 * possible, so any existing class rule still wins) or an opt-in class.
 *
 * Tokens only — it follows light/dark for free. `var()` fallbacks are there because
 * deepfakes-and-startups.html names its text token `--text`, not `--text-primary`.
 */

/* ── 1. Baseline ──────────────────────────────────────────────────────────────
   A link inside body copy: accent colour AND an underline. Both, deliberately —
   colour alone is not a link marker for anyone who cannot separate blue from black.
   The underline is thin, offset off the baseline and only 35 % opaque, so it reads as
   typography rather than as a 1995 hyperlink; hover brings it to full strength. */
a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transition: color .15s ease, text-decoration-color .15s ease;
}
a:hover {
  color: var(--accent-hover, var(--accent));
  text-decoration-color: currentColor;
}

/* An <a> with no href is not a link to the browser: no hand cursor, and it cannot be
   reached with Tab. We give the real ones an href instead — this is the safety net. */
a:not([href]) { cursor: pointer; }

/* Nothing in this site showed a keyboard user where they were. Now everything does. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── 2. The action link ───────────────────────────────────────────────────────
   "See prices →", "Read the study →". Standalone, ends a paragraph, points somewhere.
   No underline (it is not sitting inside a sentence), semibold, and the arrow comes
   from CSS so it can move on hover — an arrow typed into the markup cannot.

   So: do NOT type &rarr; into the text as well, or the link ends up with two arrows. */
.link-arrow {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: .35em;
  transition: color .15s ease;
}
.link-arrow::after {
  content: "\2192";                       /* → */
  font-size: .95em;
  opacity: .7;
  transition: transform .18s ease, opacity .18s ease;
}
.link-arrow:hover { color: var(--accent-hover, var(--accent)); text-decoration: none; }
.link-arrow:hover::after { transform: translateX(3px); opacity: 1; }

/* Leaves the site. Different arrow, and it leans out rather than sliding along —
   the direction of the animation says which kind of link it is before you read it. */
.link-arrow.ext::after { content: "\2197"; }  /* ↗ */
.link-arrow.ext:hover::after { transform: translate(2px, -2px); }

/* Goes back where you came from. The arrow moves to the FRONT, because a back link
   that keeps its arrow on the right reads as forward at a glance. Same rule as the
   others: the arrow is CSS, so never type &larr; into the markup as well. */
.link-arrow.back::after { content: none; }
.link-arrow.back::before {
  content: "\2190";                       /* ← */
  font-size: .95em;
  opacity: .7;
  transition: transform .18s ease, opacity .18s ease;
}
.link-arrow.back:hover::before { transform: translateX(-3px); opacity: 1; }

/* ── 2b. A button that is really a link out ──────────────────────────────────
   A `.btn` leaving the site gets the same ↗ as `.link-arrow.ext`, from CSS rather than
   typed into the label — so it animates, and a screen reader does not read the arrow
   aloud as a word. Only `a.btn`, and only with target="_blank": a real <button> and an
   in-site button are left alone. */
a.btn[target="_blank"]::after {
  content: "\2197";
  font-size: .95em;
  opacity: .7;
  transition: transform .18s ease, opacity .18s ease;
}
a.btn[target="_blank"]:hover::after { transform: translate(2px, -2px); opacity: 1; }

/* ── 3. The quiet link ────────────────────────────────────────────────────────
   Footers, fine print, source lists: reads as ordinary text, becomes a link on hover.
   The same behaviour .footer-links / .bs-foot-links already had, named once. */
.link-quiet {
  color: var(--text-secondary);
  text-decoration: none;
}
.link-quiet:hover { color: var(--accent); text-decoration: none; }

/* ── 4. Reduced motion ────────────────────────────────────────────────────────
   The arrow slide is decoration. If the visitor has asked their system to stop moving
   things, it stops moving. The colour change stays — that one carries information. */
@media (prefers-reduced-motion: reduce) {
  .link-arrow::after,
  .link-arrow:hover::after,
  .link-arrow.back::before,
  .link-arrow.back:hover::before,
  a.btn[target="_blank"]::after,
  a.btn[target="_blank"]:hover::after { transition: none; transform: none; }
}
