/* ═══════════════════════════════════════════════════════════════
   HVAC247PRO — Modern CSS Reset
   ─────────────────────────────────────────────────────────────
   Targeted, fast, no `*` blanket rules that hurt perf.
   Inspired by Andy Bell + Josh Comeau, slimmed to essentials.
   ═══════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* Smooth scroll for in-page anchors; user can override */
  scroll-behavior: smooth;
  /* Prevent iOS text size auto-inflate on landscape */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Better font kerning on modern browsers */
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100svh;
  min-height: 100vh; /* fallback */
  line-height: var(--leading-normal);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--surface-0);
  text-rendering: optimizeLegibility;
  /* Prevent horizontal scroll from off-canvas elements */
  overflow-x: hidden;
}

/* Headings — remove default margins, let typography.css set them */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

p, ul, ol, dl, blockquote, figure {
  margin: 0;
}

/* Lists — strip defaults when used as nav/grid; keep semantic markers when not */
ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

/* Anchors */
a {
  color: inherit;
  text-decoration: none;
  text-decoration-skip-ink: auto;
}

/* Media — block by default, never overflow */
img, picture, video, canvas, svg, iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  font-style: italic;          /* graceful alt fallback */
  background-repeat: no-repeat;
  background-size: cover;
  vertical-align: middle;
}

/* Form elements — inherit fonts, sane defaults */
input, button, textarea, select {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
  color: inherit;
}

button:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

textarea {
  resize: vertical;
  min-height: 6rem;
}

/* Strip number input spinners (mobile-friendly numeric inputs) */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
}

/* Hidden / dialog */
[hidden] { display: none !important; }

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
}

dialog::backdrop {
  background: rgba(6, 15, 28, 0.78);
  backdrop-filter: blur(6px);
}

/* Focus — visible only via keyboard nav */
:focus { outline: none; }

:focus-visible {
  outline: var(--ring-width) solid var(--ring-color);
  outline-offset: var(--ring-offset);
  border-radius: var(--radius-xs);
}

/* Selection */
::selection {
  background: var(--color-gold-400);
  color: var(--color-navy-950);
}

/* Scrollbar (Firefox + WebKit) — restrained, brand-aware */
:root {
  scrollbar-color: var(--color-navy-500) var(--surface-0);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--surface-0);
}
::-webkit-scrollbar-thumb {
  background: var(--color-navy-500);
  border: 3px solid var(--surface-0);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-navy-400);
}

/* SVG inherits color */
svg {
  fill: currentColor;
}

/* Better hr default */
hr {
  border: 0;
  height: 1px;
  background: var(--border-default);
  margin: var(--space-8) 0;
}

/* Address default for screen reader skip nav */
.sr-only,
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-link recovery when focused */
.sr-only:focus,
.visually-hidden:focus {
  position: fixed;
  inset: var(--space-3) auto auto var(--space-3);
  width: auto;
  height: auto;
  clip: auto;
  padding: var(--space-3) var(--space-5);
  background: var(--color-gold-400);
  color: var(--color-navy-950);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-md);
  z-index: var(--z-max);
}
