/* ==========================================================
   GLOBAL — resets, body, typography, layout, buttons
   "The Field" design system
   ========================================================== */

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; cursor: pointer; }
button { font-family: inherit; cursor: pointer; }
ul, ol { list-style: none; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

::selection { background: var(--red); color: #fff; }

/* --- Layout primitives --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section       { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.section--tight{ padding: clamp(2.5rem, 5vw, 4rem) 0; }
.grid { display: grid; gap: var(--gutter); }

/* --- Typography scale --- */
.h-display {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink);
}
.h-display em { font-style: normal; color: var(--red); }

/* Interior page-hero variant — one size for every dark hero title
   (blog, contact, safety, tools, search) instead of per-template
   inline clamps. */
.h-page {
  font-size: clamp(2.25rem, 5.5vw, 4.5rem);
  margin: 1rem 0 1.5rem;
}

.h-2 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.h-3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--ink);
}

.lead {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  font-weight: 500;
  color: var(--ink-soft);
  max-width: 58ch;
}

.eyebrow {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--red);
}

.spec-tag {
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }

/* --- Section head (eyebrow + heading) --- */
.section-head {
  margin-bottom: clamp(2.2rem, 4.5vw, 3.4rem);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.05rem 2rem;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  transition: all 0.22s var(--ease);
  cursor: pointer;
}
.btn .arrow { transition: transform 0.22s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* Primary — brand red fill */
.btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--red-bright);
  border-color: var(--red-bright);
  color: #fff;
}

/* Ghost — outline; adapts on dark via .on-dark scope */
.btn--ghost {
  border-color: var(--line-lt-2);
  color: var(--ink);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--ink);
}
.on-dark .btn--ghost,
.btn--ghost.btn--inverse {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.on-dark .btn--ghost:hover,
.btn--ghost.btn--inverse:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.btn--sm { padding: 0.7rem 1.25rem; font-size: 11px; }

.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* --- Legacy .frame class — corner brackets retired in The Field.
       Frame corner spans render invisibly; .frame keeps position only. --- */
.frame { position: relative; }
.frame-c1, .frame-c2 { display: none; }

/* ==========================================================
   SCROLL ANIMATION SYSTEM
   Driven by a single IntersectionObserver in nav.js, which adds
   .in the first time an element crosses the viewport threshold.
   Three variants, all reduced-motion safe:
     .reveal          single element, fade + rise
     .reveal-stagger   grid/list — children cascade in one after
                       another (parent is observed, not children)
     .reveal-photo     full-bleed image band — image scales down
                       from a slight zoom as it settles into view
   ========================================================== */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal-stagger.in > * { opacity: 1; transform: none; }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0.02s; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 0.14s; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 0.26s; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 0.32s; }
.reveal-stagger.in > *:nth-child(n+7) { transition-delay: 0.36s; }

.reveal-photo { overflow: hidden; }
.reveal-photo > img,
.reveal-photo .reveal-photo__zoom {
  transform: scale(1.08);
  transition: transform 1.3s var(--ease);
}
.reveal-photo.in > img,
.reveal-photo.in .reveal-photo__zoom {
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
  .reveal-photo > img,
  .reveal-photo .reveal-photo__zoom { transform: none; transition: none; }
}

/* --- Floating WhatsApp button --- */
.float-wa {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 54px;
  height: 54px;
  background: #25d366;
  color: #08251c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.4);
  z-index: 90;
  transition: transform 0.2s var(--ease);
}
.float-wa:hover { transform: translateY(-3px); }
.float-wa svg { width: 26px; height: 26px; }

/* --- Skip link --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--red);
  color: #fff;
  padding: 0.8rem 1.2rem;
  z-index: 200;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

/* --- Screen-reader only --- */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* --- 404 page (404.php) --- */
.err-404 {
  position: relative;
  isolation: isolate;
  color: #fff;
  text-align: center;
  padding: clamp(6rem, 14vw, 11rem) 0;
  overflow: hidden;
}
.err-404__img { position: absolute; inset: 0; z-index: -2; }
.err-404__img img { width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.err-404::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(12, 10, 9, 0.6), rgba(12, 10, 9, 0.78));
}
.err-404__label {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--amber);
  display: block;
}
.err-404__title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 0.95;
  text-transform: uppercase;
  margin-top: 1rem;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}
.err-404__lead {
  max-width: 48ch;
  margin: 1.4rem auto 0;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}
.err-404__btns {
  margin-top: 2.4rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Generic page hero (page.php) --- */
.page-hero {
  background: var(--char);
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}
.page-hero .eyebrow { color: var(--red-bright); }
.page-hero__title {
  color: var(--t-strong);
  font-size: clamp(2rem, 4.8vw, 3.6rem);
  margin-top: 0.8rem;
}
