/* ===============================
BASE — reset, root, fonts, typography
================================ */

/* ---------- @font-face (self-hosted) ---------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-400.woff2") format("woff2");
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-500.woff2") format("woff2");
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-600.woff2") format("woff2");
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-700.woff2") format("woff2");
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../vendor/fonts/plus-jakarta-sans/plus-jakarta-sans-800.woff2") format("woff2");
}

/* ---------- :root tokens ---------- */
:root {
  --color-primary: #0283ff;
  --color-primary-hover: #0074e3;
  --color-accent: #0168d1;
  --color-navy: #0b192f;
  --color-navy-deep: #0c1a31;
  --color-text: #1e1f23;
  --color-white: #ffffff;
  --color-nav-underline: #e3f2fd;
  --color-border-soft: rgba(255, 255, 255, 0.2);
  --color-border-muted: #d2d2d3;
  --color-dark: #1e1f23;
  --color-footer-bar: #1b1f22;
  --color-muted: #464646;
  --font-family: "Plus Jakarta Sans", sans-serif;
  --radius-pill: 4.2rem; /* Figma 42px */
  --transition-fast: 0.25s ease;
  --header-inline: 12.1rem; /* Figma 121px */
  --header-sticky-offset: 12rem; /* sticky bar clearance for pinned sections */
  --z-header: 100;
  --z-menu: 110;
}

/* ---------- Root font-size (mandatory) ---------- */
html {
  font-size: 0.534vw; /* desktop: 1rem ≈ 10px at 1920px */
  /* Avoid CSS scroll-behavior:smooth — it fights ScrollTrigger pin/scrub (Elementor pattern) */
}

@media (max-width: 992px) {
  html {
    font-size: 62.5%; /* mobile/tablet: 1rem = 10px */
  }
}

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

body {
  margin: 0;
  font-family: var(--font-family);
  font-weight: 500;
  /* Figma 18px */
  font-size: 1.8rem;
  line-height: 1.5;
  color: var(--color-white);
  background: var(--color-navy);
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

/*
  Load gate (HTML + WordPress):
  - Early head script adds html.js.anim-pending
  - Hero entrance stays hidden until fonts.ready + gsap.js clears the class
  - Stops: system font flash → custom font → then animation restart
*/
html.js.anim-pending .js-title-flip,
html.js.anim-pending .js-title-flip-on-scroll,
html.js.anim-pending .js-service-item,
html.js.anim-pending .hero__copy .hero__text,
html.js.anim-pending .hero__copy .hero__actions {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  html.js.anim-pending .js-title-flip,
  html.js.anim-pending .js-title-flip-on-scroll,
  html.js.anim-pending .js-service-item,
  html.js.anim-pending .hero__copy .hero__text,
  html.js.anim-pending .hero__copy .hero__actions {
    opacity: 1;
  }
}

/* WordPress site wrapper — no layout side effects */
#page.site {
  min-height: 100%;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* ---------- Title flip helpers ---------- */
.title-word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  perspective: 80rem;
}

.title-word {
  display: inline-block;
  transform-origin: 50% 100%;
  will-change: transform, opacity;
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .title-word {
    will-change: auto;
  }
}
