/* ============================================================
   Tools cluster v2 — tool-app reskin layer
   ============================================================
   Scope: the standalone tool apps under deploy/public_html/
   (body.tools-v2): hackcheck, scam-check, link-checker,
   opsec-planner, checkurlink, ugquiz (+ugquiz.html), qaphela,
   goldphish, complexliving, demo.

   Layers ON TOP of each app's own stylesheet(s), which stay
   untouched. Purpose (Phase 6, 2026-09-14):
   - Force the signed-off dark homepage palette on these apps even
     if data-theme="light" is set (dark-only until the global phase
     removes the theme toggle site-wide).
   - Mirror homepage tokens: teal #3BDBBF, Neue Regrade headings and
     body, Monomials labels/kickers/numerals, ~24px card radii,
     subtle teal hairline borders, near-black surfaces, dark inputs
     with teal focus rings.
   - Generic chrome-level coverage only: body/typography/links,
     plain <button>/<input>/<select>/<textarea> elements, and the
     common .card/.panel/.result/.results surface names. Each app
     keeps its own layout and any class-level styling of its own;
     where an app already styles a control via its own classes it
     usually wins or the two agree on the dark+teal language.

   Fonts: @font-face blocks mirror css/services-v2.css — local
   woff2 from /fonts/, no third-party requests. Weight 400 maps to
   the 300 file as a stand-in until a true 400 cut lands.
   ============================================================ */

/* ── Local fonts (files verified present in /fonts/) ─────── */
@font-face {
  font-family: 'Neue Regrade';
  src: url('/fonts/neue-regrade-300.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Neue Regrade';
  src: url('/fonts/neue-regrade-300.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  /* stand-in: no 400 cut delivered yet; global phase will re-cut */
}
@font-face {
  font-family: 'Neue Regrade';
  src: url('/fonts/neue-regrade-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Monomials';
  src: url('/fonts/monomials-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ── Token overrides: force the dark homepage palette ──────
   Set directly on body.tools-v2 so they beat any value inherited
   from html[data-theme="light"] and keep the cluster dark-only. */
body.tools-v2 {
  color-scheme: dark;

  /* type: homepage stacks (Neue Regrade first, Monomials mono) */
  --font-display: "Neue Regrade", "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Monomials", "Space Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* accent: Brief teal override of the older #3CDBC0 */
  --accent: #3BDBBF;
  --accent-hover: #2FC4AB;
  --accent-ink: #06231E;
  --accent-soft: rgba(59, 219, 191, .12);

  /* surfaces: near-black, no blue cast */
  --bg-0: #0B0B0C;
  --bg-1: #111315;
  --bg-2: #17191C;
  --bg-glass: rgba(255, 255, 255, .05);
  --bg-glass-brd: rgba(255, 255, 255, .10);

  /* text */
  --text-hi: #FFFFFF;
  --text-body: rgba(255, 255, 255, .78);
  --text-mute: rgba(255, 255, 255, .55);

  /* lines: subtle teal hairline instead of neutral grey */
  --line: rgba(59, 219, 191, .16);

  /* code / mono surfaces */
  --code-bg: #101012;

  /* corners: homepage-soft (24px cards) */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
}

/* ── Base enforcement ──────────────────────────────────────
   The html[data-theme="light"] variants repeat the same
   declarations with higher specificity so a light theme flag on
   <html> (some apps toggle it there) cannot re-light the page. */
body.tools-v2,
html[data-theme="light"] body.tools-v2 {
  background: var(--bg-0);
  color: var(--text-body);
  font-family: var(--font-display);
  letter-spacing: .002em;
}
body.tools-v2 h1,
body.tools-v2 h2,
body.tools-v2 h3,
body.tools-v2 h4 {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
  color: var(--text-hi);
}
body.tools-v2 p,
body.tools-v2 li,
body.tools-v2 dd,
body.tools-v2 blockquote { color: var(--text-body); }
body.tools-v2 small,
body.tools-v2 figcaption { color: var(--text-mute); }

/* Links ride the accent */
body.tools-v2 a { color: var(--accent); }
body.tools-v2 a:hover { color: var(--accent-hover); }

/* Text selection */
body.tools-v2 ::selection {
  background: rgba(59, 219, 191, .28);
  color: #FFFFFF;
}

/* Kickers / eyebrows / mono labels: Monomials, teal */
body.tools-v2 .eyebrow,
body.tools-v2 .kicker,
body.tools-v2 .mono,
body.tools-v2 .tag,
body.tools-v2 .badge {
  font-family: var(--font-mono);
  font-weight: 400;
}

/* Horizontal rules: teal hairline */
body.tools-v2 hr {
  border: none;
  border-top: 1px solid rgba(59, 219, 191, .16);
}

/* ── Generic surfaces: one dark family ─────────────────────
   .card/.panel/.result/.results are the shared surface names
   across the tool apps; give them the homepage card treatment.
   Apps with their own card styling either win via more specific
   selectors or land on the same dark+teal language. */
body.tools-v2 .card,
body.tools-v2 .panel,
body.tools-v2 .result,
body.tools-v2 .result-box,
body.tools-v2 .results {
  background: var(--bg-1);
  border: 1px solid rgba(59, 219, 191, .16);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .24);
  color: var(--text-body);
}
body.tools-v2 .card h1,
body.tools-v2 .card h2,
body.tools-v2 .card h3,
body.tools-v2 .panel h1,
body.tools-v2 .panel h2,
body.tools-v2 .panel h3,
body.tools-v2 .result h1,
body.tools-v2 .result h2,
body.tools-v2 .result h3 { color: var(--text-hi); }

/* ── Buttons: element-level defaults only ──────────────────
   Deliberately targets <button> elements (not .btn classes) so
   art-directed campaign pages whose CTAs are <a class="btn">
   keep their own buttons, while unclassed/plain buttons in the
   tool UIs pick up the homepage chrome. App rules that style
   <button> through their own more specific selectors still win. */
body.tools-v2 button {
  font-family: var(--font-display);
  background: var(--bg-2);
  color: var(--text-hi);
  border: 1px solid rgba(59, 219, 191, .30);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 240ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 240ms cubic-bezier(0.22, 1, 0.36, 1),
              color 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (hover: hover) and (pointer: fine) {
  body.tools-v2 button:hover:not(:disabled) {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
  }
}
body.tools-v2 button:disabled {
  opacity: .5;
  cursor: not-allowed;
}
/* Primary action: accent fill */
body.tools-v2 button[type="submit"],
body.tools-v2 button.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 8px 22px rgba(59, 219, 191, .22);
}
@media (hover: hover) and (pointer: fine) {
  body.tools-v2 button[type="submit"]:hover:not(:disabled),
  body.tools-v2 button.primary:hover:not(:disabled) {
    background: var(--accent-hover);
    color: var(--accent-ink);
    box-shadow: 0 12px 28px rgba(59, 219, 191, .32);
  }
}
body.tools-v2 button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Form inputs: dark fields with teal focus ring ─────────
   Enumerated text-ish types + select + textarea; checkbox,
   radio, range, file and colour inputs are left to
   color-scheme: dark so native controls stay coherent. */
body.tools-v2 input[type="text"],
body.tools-v2 input[type="email"],
body.tools-v2 input[type="url"],
body.tools-v2 input[type="password"],
body.tools-v2 input[type="search"],
body.tools-v2 input[type="tel"],
body.tools-v2 input[type="number"],
body.tools-v2 select,
body.tools-v2 textarea {
  background: var(--bg-2);
  color: var(--text-hi);
  border: 1px solid rgba(59, 219, 191, .18);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
}
body.tools-v2 input::placeholder,
body.tools-v2 textarea::placeholder { color: var(--text-mute); }
body.tools-v2 input[type="text"]:focus,
body.tools-v2 input[type="email"]:focus,
body.tools-v2 input[type="url"]:focus,
body.tools-v2 input[type="password"]:focus,
body.tools-v2 input[type="search"]:focus,
body.tools-v2 input[type="tel"]:focus,
body.tools-v2 input[type="number"]:focus,
body.tools-v2 select:focus,
body.tools-v2 textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 219, 191, .18);
}

/* Field labels */
body.tools-v2 label { color: var(--text-body); }

/* ── Tables: dark with teal hairlines, Monomials headers ─── */
body.tools-v2 table {
  border-collapse: collapse;
  background: var(--bg-1);
  color: var(--text-body);
}
body.tools-v2 th,
body.tools-v2 td {
  border: 1px solid rgba(59, 219, 191, .14);
  padding: .5em .75em;
}
body.tools-v2 th {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .78rem;
  color: var(--accent);
  background: var(--bg-2);
}

/* ── Code blocks ─────────────────────────────────────────── */
body.tools-v2 code,
body.tools-v2 pre,
body.tools-v2 kbd,
body.tools-v2 samp {
  font-family: var(--font-mono);
  background: var(--code-bg);
  color: var(--text-body);
  border-radius: var(--radius-sm);
}
body.tools-v2 pre {
  border: 1px solid rgba(59, 219, 191, .14);
  padding: 1em;
  overflow-x: auto;
}

/* ── App footers: dark anchor with teal top rule ─────────── */
body.tools-v2 footer {
  background: var(--bg-0);
  border-top: 1px solid rgba(59, 219, 191, .25);
  color: var(--text-mute);
}

/* ── Reduced motion: respect the homepage rule ───────────── */
@media (prefers-reduced-motion: reduce) {
  body.tools-v2 *,
  body.tools-v2 *::before,
  body.tools-v2 *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Skip link: visually hidden until keyboard focus (mirrors ug-brand.css) */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  z-index: 2000;
  transition: top 120ms ease;
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }
