/* ==========================================================================
   PowerWave AV — BASE
   Reset, typography, focus states, utilities, reveal/reduced-motion rules and
   the custom-cursor switch.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Keeps anchored sections clear of the sticky nav */
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

::selection {
  background: var(--orange-1);
  color: var(--ink-on-accent);
}

/* ---- Focus: always visible for keyboard users ---- */
:focus-visible {
  outline: 3px solid var(--blue-2);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---- Layout helper ---- */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* ---- Accessibility helpers ---- */
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: calc(var(--z-nav) + 10);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink-on-accent);
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Scroll reveal ----
   Elements flagged [data-reveal] stay hidden ONLY while the `js` class is on
   <html> and Anime.js hasn't revealed them yet. index.html removes the `js`
   class again if the scripts fail to boot, so content is never lost. */
.js [data-reveal]:not([data-revealed]) {
  opacity: 0;
}

/* ---- Custom screwdriver cursor (fine pointers only; see cursor.js) ---- */
.has-custom-cursor,
.has-custom-cursor * {
  cursor: none !important;
}

.pw-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-cursor);
  width: 36px;
  height: 36px;
  pointer-events: none;
  opacity: 0;
  transform-origin: 4px 4px; /* the screwdriver tip = the real pointer hotspot */
  transition: opacity 0.2s ease;
  will-change: transform;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
}

.pw-cursor.is-visible {
  opacity: 1;
}

.pw-cursor svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pw-cursor.is-hover .pw-cursor__glow {
  opacity: 1;
}

.pw-cursor__glow {
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* ---- Reduced motion: no smooth scroll, no hidden-until-animated content ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js [data-reveal]:not([data-revealed]) {
    opacity: 1;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
