/* ==========================================================================
   Tower Performance LLC — reset and element defaults
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--tp-header-h) + var(--tp-space-6));
}

body {
  margin: 0;
  background: var(--tp-surface);
  color: var(--tp-text);
  font-family: var(--tp-font-body);
  font-size: var(--tp-body);
  line-height: var(--tp-leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Headings ----------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--tp-space-4);
  font-family: var(--tp-font-heading);
  color: var(--tp-text);
  text-wrap: balance;
}

h1 {
  font-size: var(--tp-h1);
  font-weight: 700;
  line-height: var(--tp-leading-h1);
  letter-spacing: var(--tp-track-h1);
}

h2 {
  font-size: var(--tp-h2);
  font-weight: 700;
  line-height: var(--tp-leading-h2);
  letter-spacing: var(--tp-track-h2);
}

h3 {
  font-size: var(--tp-h3);
  font-weight: 600;
  line-height: var(--tp-leading-h3);
  letter-spacing: var(--tp-track-h3);
}

h4 {
  font-size: var(--tp-h4);
  font-weight: 600;
  line-height: 1.35;
}

p {
  margin: 0 0 var(--tp-space-5);
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

/* --- Links -------------------------------------------------------------- */
a {
  color: var(--tp-text-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--tp-fast) var(--tp-ease);
}

a:hover {
  color: var(--tp-text-link-hover);
}

/* --- Focus — never removed --------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--tp-focus-ring);
  outline-offset: 2px;
  border-radius: var(--tp-radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* --- Media -------------------------------------------------------------- */
img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  border: 0;
}

/* --- Lists -------------------------------------------------------------- */
ul,
ol {
  margin: 0 0 var(--tp-space-5);
  padding-left: var(--tp-space-6);
}

li + li {
  margin-top: var(--tp-space-2);
}

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

/* --- Forms -------------------------------------------------------------- */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* --- Rules -------------------------------------------------------------- */
hr {
  height: 1px;
  margin: var(--tp-space-12) 0;
  border: 0;
  background: var(--tp-border);
}

/* --- Code / part numbers ----------------------------------------------- */
code,
kbd,
samp {
  font-family: var(--tp-font-mono);
  font-size: 0.9375em;
}

/* --- Selection ---------------------------------------------------------- */
::selection {
  background: var(--tp-green-100);
  color: var(--tp-gray-900);
}

/* --- Accessibility helpers --------------------------------------------- */
.tp-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;
}

.tp-skip-link {
  position: absolute;
  top: var(--tp-space-2);
  left: var(--tp-space-2);
  z-index: 200;
  padding: var(--tp-space-3) var(--tp-space-5);
  background: var(--tp-surface);
  color: var(--tp-text);
  font-weight: 600;
  border: 2px solid var(--tp-green);
  border-radius: var(--tp-radius-md);
  transform: translateY(-150%);
  transition: transform var(--tp-fast) var(--tp-ease);
}

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

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

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