/*
 * STRUCORA — GLOBAL STYLES
 * ------------------------------------
 * Base resets, typography defaults, and shared utilities.
 * Component styles live alongside their components.
 */

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--color-warm-bg);
  color: var(--color-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[lang="ar"] body {
  font-family: var(--font-ar);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

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

input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  outline: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--color-primary);
}

p {
  margin: 0;
  color: var(--color-primary);
  opacity: 0.86;
}

::selection {
  background: var(--color-primary);
  color: var(--color-warm-bg);
}

/* Subtle noise texture overlay applied via .noise utility */
.noise {
  position: relative;
}
.noise::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.025;
  mix-blend-mode: multiply;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-pad);
}

/* Section vertical rhythm */
.section {
  padding-block: clamp(64px, 9vw, 160px);
}
.section--tight {
  padding-block: clamp(48px, 6vw, 96px);
}

/* Lightweight replacement for the former scroll-reveal component. */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.service-row__desc.is-open {
  opacity: 0.78;
  max-height: 120px;
  margin-top: 6px;
}

[hidden] {
  display: none !important;
}

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

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

/* Custom cursor — desktop only, hidden on touch */
@media (hover: hover) and (pointer: fine) {
  .custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 28px;
    height: 28px;
    border: 1px solid var(--color-primary);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width var(--dur-fast) var(--ease-out),
      height var(--dur-fast) var(--ease-out),
      opacity var(--dur-fast) var(--ease-out),
      background-color var(--dur-fast) var(--ease-out);
    z-index: 9999;
    mix-blend-mode: difference;
    opacity: 0;
  }
  .custom-cursor.is-active {
    opacity: 1;
  }
  .custom-cursor.is-hover {
    width: 48px;
    height: 48px;
    background: var(--color-primary);
  }
}

/* Scrollbar — subtle */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--color-warm-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-line-strong);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}