/* ==========================================================================
   Base — reset, RTL typography, layout primitives, ambient atmosphere
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* Lenis owns smooth scroll */
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text);
  background: var(--page-bg);
  transition: background 900ms var(--ease-in-out);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Grain / atmosphere overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

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

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

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

input,
textarea {
  font: inherit;
  color: inherit;
}

ul {
  list-style: none;
}

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

/* ---- Headings use the display face ---- */
h1,
h2,
h3,
.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 0.5rem + 4vw, 3rem);
  position: relative;
  z-index: var(--z-content);
}

.section {
  position: relative;
  padding-block: var(--space-section);
}

/* ---- Section eyebrow / heading kit ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--cyan);
  margin-bottom: var(--space-2);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--grad);
  border-radius: 2px;
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: 900;
  margin-bottom: var(--space-3);
}

.section-lead {
  color: var(--text-muted);
  max-width: 52ch;
  font-size: var(--text-lg);
}

.text-grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---- Ambient morphing blobs ---- */
.blob {
  position: absolute;
  z-index: 0;
  filter: blur(70px);
  opacity: 0.5;
  pointer-events: none;
  border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
  animation: blobMorph 16s ease-in-out infinite;
}

@keyframes blobMorph {
  0%,
  100% {
    border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%;
    transform: rotate(0deg) scale(1);
  }
  50% {
    border-radius: 63% 37% 38% 62% / 56% 63% 37% 44%;
    transform: rotate(180deg) scale(1.12);
  }
}

/* ---- Reveal utility (JS adds .is-in) ---- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Accessibility: visible focus */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.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;
}
