/* ─── TOKENS ─── */

:root {
  --color-paper: #030201;
  --color-paper-strong: #0a0906;
  --color-ink: #f6f5f1;
  --color-ink-mid: #8e998a;
  --color-ink-soft: #817f78;
  --color-ink-muted: #474d45;
  --color-accent: #58bf4f;
  --color-accent-deep: #3d9835;
  --color-emergency: #ff5454;
  --color-border: rgba(246, 245, 241, 0.1);
  --color-border-strong: rgba(246, 245, 241, 0.18);
  --color-shadow: rgba(0, 0, 0, 0.6);

  --font-display: "Jua", sans-serif;
  --font-body: "IBM Plex Mono", monospace;
  --font-sans: "IBM Plex Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --step--1: clamp(0.75rem, 0.72rem + 0.18vw, 0.875rem);
  --step-0: clamp(0.875rem, 0.84rem + 0.2vw, 1rem);
  --step-1: clamp(1.1rem, 1rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.35rem + 1vw, 2.0625rem);
  --step-3: clamp(2rem, 1.6rem + 1.8vw, 3.5rem);
  --step-4: clamp(3rem, 2rem + 4vw, 4.5rem);

  --space-1: clamp(0.4rem, 0.34rem + 0.2vw, 0.55rem);
  --space-2: clamp(0.72rem, 0.62rem + 0.35vw, 0.92rem);
  --space-3: clamp(1rem, 0.88rem + 0.6vw, 1.4rem);
  --space-4: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  --space-5: clamp(1.9rem, 1.45rem + 1.45vw, 2.9rem);
  --space-6: clamp(2.8rem, 2rem + 2.6vw, 4.8rem);
  --space-7: clamp(4rem, 2.9rem + 4vw, 6.8rem);
  --space-8: clamp(5.4rem, 3.7rem + 6vw, 9rem);

  --radius-soft: 0.375rem;
  --radius-card: 0.75rem;
  --radius-pill: 999rem;
  --border-main: 0.0625rem;
  --transition-fast: 180ms ease;
  --transition-main: 320ms cubic-bezier(0.22, 1, 0.36, 1);

  --page-width: min(94vw, 75rem);
}

/* ─── RESET ─── */

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

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-ink);
  background-color: var(--color-paper);
  overflow-x: clip;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.028;
  pointer-events: none;
  z-index: 9999;
}

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

/* ─── CURSOR TRAIL ─── */

@media (hover: hover) and (pointer: fine) {
  body,
  a,
  button,
  summary,
  input,
  select,
  textarea,
  [role="button"],
  [tabindex] {
    cursor: none;
  }

  .cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transform: translate(-50%, -50%);
    will-change: left, top, opacity, transform, filter;
    background: radial-gradient(circle,
      rgba(198, 255, 136, 0.9) 0%,
      rgba(150, 220, 90, 0.5) 18%,
      rgba(88, 191, 79, 0.18) 40%,
      rgba(88, 191, 79, 0.05) 60%,
      rgba(88, 191, 79, 0) 74%
    );
    filter: blur(14px);
    transition:
      transform 560ms ease-out,
      filter 560ms ease-out,
      opacity 560ms ease-out;
  }

  .cursor-glow.is-visible {
    opacity: 0.32;
  }

  .cursor-glow.is-interactive {
    opacity: 0.68;
    transform: translate(-50%, -50%) scale(1.22);
    filter: blur(11px);
    transition:
      transform 380ms cubic-bezier(0.22, 1, 0.36, 1),
      filter 380ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 380ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.is-button-hovered .cursor-glow {
    opacity: 0 !important;
    transition: opacity var(--transition-fast);
  }

  .cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
  }

  .cursor-trail__circle {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--color-accent);
    opacity: 0;
    transform: translate(-50%, -50%);
    will-change: left, top, opacity, background-color;
  }
}

/* ─── WHITE CURSOR GLOW (pages with data-cursor-color on body) ─── */

[data-cursor-color] .cursor-glow {
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(220, 220, 220, 0.45) 18%,
    rgba(200, 200, 200, 0.15) 40%,
    rgba(200, 200, 200, 0.04) 60%,
    rgba(200, 200, 200, 0) 74%
  );
  filter: blur(14px);
}

[data-cursor-color] .cursor-glow.is-interactive {
  background: radial-gradient(circle,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(220, 220, 220, 0.55) 18%,
    rgba(200, 200, 200, 0.2) 40%,
    rgba(200, 200, 200, 0.05) 60%,
    rgba(200, 200, 200, 0) 74%
  );
}

/* ─── TOUCH GLOW ─── */

@media (pointer: coarse) {
  .touch-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 14rem;
    height: 14rem;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transform: translate(-50%, -50%);
    will-change: left, top, opacity;
    background: radial-gradient(circle,
      rgba(198, 255, 136, 0.9) 0%,
      rgba(150, 220, 90, 0.5) 20%,
      rgba(88, 191, 79, 0.18) 45%,
      rgba(88, 191, 79, 0.05) 65%,
      rgba(88, 191, 79, 0) 78%
    );
    filter: blur(18px);
    transition: opacity 3000ms ease-out;
  }

  .touch-glow.is-active {
    opacity: 0.45;
    transition: opacity 140ms ease-out;
  }
}

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

p,
h1,
h2,
h3,
ul,
figure {
  margin: 0;
}

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

summary {
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

/* ─── SHARED BACKDROP ─── */

.site_backdrop_wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  overflow: clip;
}

.home_hero_wrap,
.home_services_wrap,
.home_footer_wrap,
.shopify_nav_wrap,
.shopify_hero_contain,
.shopify_trust_contain,
.shopify_portfolio_contain,
.shopify_portfolio_strip_outer,
.shopify_portfolio_progress_wrap,
.shopify_services_contain,
.shopify_offer_heading_wrap,
.shopify_faq_contain,
.shopify_footer_contain,
.contact_nav_wrap,
.contact_hero_wrap,
.contact_main_wrap,
.legal_nav_wrap,
.legal_hero_wrap,
.legal_main_wrap,
.site_footer_wrap {
  position: relative;
  z-index: 2;
}

.site_backdrop_grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(246, 245, 241, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(246, 245, 241, 0.05) 1px, transparent 1px);
  background-size: 8rem 8rem;
  mask-image: linear-gradient(180deg, transparent, black 22%, black 78%, transparent);
  opacity: 0.18;
}

/* ─── REDUCED MOTION ─── */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
