/* ============================================
   ANSARI GROUP CONSTRUCTION — GLOBAL STYLES
   Reset, Base, Typography, Utilities, Textures
   ============================================ */

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 80px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--steel);
  background-color: var(--concrete);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--duration-fast) var(--ease-out);
}

ul, ol {
  list-style: none;
}

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

button {
  cursor: pointer;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 400; /* Bebas Neue is only 400 */
  line-height: var(--leading-tight);
  color: var(--charcoal);
  letter-spacing: var(--tracking-wide);
}

h1 { font-size: var(--text-hero); }
h2 { font-size: clamp(2rem, 4vw + 0.5rem, var(--text-4xl)); }
h3 { font-size: clamp(1.5rem, 3vw, var(--text-3xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-md);
  line-height: var(--leading-relaxed);
}

.text-accent {
  font-family: var(--font-accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.text-amber { color: var(--amber); }
.text-red   { color: var(--red); }
.text-white { color: var(--white); }
.text-steel { color: var(--steel-light); }

/* ── Section label (small caps above headings) ── */
.section-label {
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--amber);
  margin-bottom: var(--space-sm);
  display: inline-block;
  position: relative;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 2px;
  background: var(--amber);
  vertical-align: middle;
  margin-right: var(--space-sm);
}

/* Dark section headings */
.dark-section h2,
.dark-section h3,
.dark-section h4 {
  color: var(--white);
}

.dark-section p,
.dark-section li {
  color: var(--steel-muted);
}

.dark-section .section-label {
  color: var(--amber);
}

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container--wide {
  max-width: var(--container-max);
}

.container--narrow {
  max-width: var(--container-md);
}

section {
  padding: var(--space-4xl) 0;
  position: relative;
}

/* ── Texture Overlays ── */
.texture-grain::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px;
  z-index: 1;
}

.texture-grain > * {
  position: relative;
  z-index: 2;
}

/* ── Diagonal Section Dividers ── */
.clip-top {
  clip-path: polygon(0 40px, 100% 0, 100% 100%, 0 100%);
  margin-top: -40px;
  padding-top: calc(var(--space-4xl) + 40px);
}

.clip-bottom {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), 0 100%);
  padding-bottom: calc(var(--space-4xl) + 40px);
}

/* ── Scroll Reveal Animations ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered reveal for children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out);
}

.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.5s; }

.reveal-stagger.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

/* ── Utility: Visually Hidden (for a11y) ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Selection Color ── */
::selection {
  background: var(--amber);
  color: var(--charcoal);
}

/* ── Scrollbar (Webkit) ── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--charcoal);
}
::-webkit-scrollbar-thumb {
  background: var(--steel);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--amber);
}
