/*
 * windpay.org — UI enhancement layer (2026-11-22)
 *
 * Loaded AFTER the compiled Tailwind sheet. Rules that override utilities live
 * in `@layer utilities` on purpose: the compiled sheet declares its layers, and
 * a later rule in the same layer wins on equal specificity while variants such
 * as `hover:text-white` or `sm:text-sm` (higher specificity / later media)
 * still beat it. Unlayered overrides would silently break every hover state.
 */

/* ── Typography: Space Grotesk (display) + Inter (text) + JetBrains Mono ── */
:root {
  --font-sans: "Inter", "Hind Siliguri", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: "Space Grotesk", "Inter", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Hind Siliguri", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html {
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  /* Inter: straight-sided 1, open digits, disambiguated l — clearer for amounts. */
  font-feature-settings: "cv05", "cv08", "ss03";
}

@layer utilities {
  .font-sans { font-family: var(--font-sans); }
  .font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

  h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
  }
  /* Space Grotesk tops out at 700; asking for 800 would make the browser fake it. */
  h1.font-extrabold, h2.font-extrabold, h3.font-extrabold, h4.font-extrabold,
  h1 .font-extrabold, h2 .font-extrabold { font-weight: 700; }

  /* Wordmark in the header/footer follows the display face too. */
  header .tracking-tight.font-extrabold { font-family: var(--font-display); font-weight: 700; }

  /* ── Readability: lift low-contrast greys on the dark background ── */
  .text-gray-400 { color: oklch(0.78 0.018 262); }
  .text-gray-500 { color: oklch(0.7 0.02 262); }
  .placeholder-gray-500::placeholder { color: oklch(0.66 0.02 262); }
}

/* ── Phones: minimum text sizes and comfortable tap targets ── */
@media (max-width: 639.98px) {
  @layer utilities {
    /* SVG diagram text uses attributes, not these classes, so the diagram is unaffected. */
    .text-\[8px\], .text-\[9px\] { font-size: 11px; line-height: 1.35; }
    .text-\[10px\] { font-size: 11.5px; line-height: 1.4; }
    .text-\[11px\] { font-size: 12px; line-height: 1.45; }
    .text-xs { font-size: 13px; line-height: 1.55; }

    /* Body copy in cards: a touch larger and airier. */
    p.text-xs, li.text-xs, span.text-xs { letter-spacing: 0.005em; }

    /* Filter chips (portals, FAQ) and the flowchart step tabs. */
    [id^="portal-cat-btn-"], [id^="faq-cat-btn-"] {
      min-height: 40px;
      padding-left: 16px;
      padding-right: 16px;
      font-size: 13px;
    }
    button.whitespace-nowrap.rounded-lg { min-height: 40px; }
    button.rounded-lg.px-2\.5 { min-height: 36px; }

    /* Copy-URL chips on portal cards. */
    [title="Click to copy official URL"] { min-height: 40px; }

    /* Links inside the Developers / Security panels. */
    #network ~ div a.font-mono { display: inline-block; padding-top: 10px; padding-bottom: 10px; }

    /* Domain chips in the security notice. */
    button.rounded-md.font-mono.px-2\.5 { min-height: 40px; padding-left: 12px; padding-right: 12px; }

    /* Footer links: same look, taller hit area. */
    footer .grid a, footer .grid button, footer a.transition-colors { min-height: 40px; display: inline-flex; align-items: center; }
    footer .grid { row-gap: 4px; }
    footer .lg\:col-span-5 { padding-top: 16px; }

    /* Large decorative glows: a 160px blur on a 700px element is expensive on
       phone GPUs and invisible at this size. Same look, a fraction of the cost. */
    .pointer-events-none.rounded-full[class*="blur-["] { filter: blur(56px); }
  }
}

/* ── Accessibility ── */
:focus-visible {
  outline: 2px solid #00e676;
  outline-offset: 2px;
  border-radius: 8px;
}

/* Sections land below the sticky header instead of under it. */
section[id], [id="network"] { scroll-margin-top: 88px; }

@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;
  }
}
