/* ═══════════════════════════════════════════
   BASE — Tokens, Grainy Mesh Gradient, Cursor & Buttons
   ═══════════════════════════════════════════ */
:root {
  --clr-bg:          #f2f2f6;
  --clr-surface:     rgba(255, 255, 255, 0.58);
  --clr-dark:        #0f1016;
  --clr-text:        #12131a;
  --clr-text-muted:  #565866;
  --clr-accent:      #12131a;
  --clr-accent-pop:  #4f46e5;
  --clr-accent-soft: #6366f1;
  --clr-accent-deep: #3730a3;
  --clr-border:      rgba(18, 19, 26, 0.12);
  --clr-overlay:     rgba(15, 16, 22, 0.85);

  --ff-heading: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  --ff-body:    'Inter', system-ui, -apple-system, sans-serif;

  --section-py: clamp(4.5rem, 9vw, 7.5rem);
  --container-px: clamp(1.25rem, 4vw, 3rem);
  --container-max: 1200px;

  --radius: 8px;
  --radius-sm: 6px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--ff-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--clr-text);
  background-color: #f2f2f6;
  background-image:
    radial-gradient(at 12% 14%, rgba(79, 70, 229, 0.16) 0px, transparent 50%),
    radial-gradient(at 88% 16%, rgba(14, 165, 233, 0.16) 0px, transparent 48%),
    radial-gradient(at 78% 64%, rgba(139, 92, 246, 0.12) 0px, transparent 52%),
    radial-gradient(at 16% 84%, rgba(79, 70, 229, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 45%, rgba(255, 255, 255, 0.65) 0px, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9990;
  opacity: 0.065;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%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");
}

@media (hover: hover) and (pointer: fine) {
  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button {
    cursor: none !important;
  }
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
ul { list-style: none; }
::selection { background: var(--clr-accent-pop); color: #fff; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
}
.section { padding: var(--section-py) 0; }

/* Preloader */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--clr-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.85s var(--ease-out-expo), opacity 0.6s ease;
}
.preloader.is-done { transform: translateY(-100%); pointer-events: none; }
.preloader__inner { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.preloader__logo { font-family: var(--ff-heading); font-size: 2.75rem; font-weight: 700; letter-spacing: -0.03em; }
.preloader__logo span { color: var(--clr-accent-soft); }
.preloader__bar { width: 140px; height: 2px; background: rgba(255,255,255,0.16); border-radius: 2px; overflow: hidden; }
.preloader__bar-fill { width: 0%; height: 100%; background: var(--clr-accent-soft); animation: loadProgress 0.75s var(--ease-out-expo) forwards; }
@keyframes loadProgress { to { width: 100%; } }

/* Custom Cursor */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.25s ease;
}
body.has-custom-cursor .cursor-dot,
body.has-custom-cursor .cursor-ring { opacity: 1; }
.cursor-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clr-accent-pop);
  transition: transform 0.15s ease, opacity 0.25s ease;
}
.cursor-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(18, 19, 26, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.3s var(--ease-out-expo), height 0.3s var(--ease-out-expo), background 0.3s ease, border-color 0.3s ease, opacity 0.25s ease;
}
.cursor-ring__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cursor-ring.is-pointer {
  width: 54px;
  height: 54px;
  border-color: var(--clr-accent-pop);
  background: rgba(79, 70, 229, 0.09);
}
.cursor-ring.is-view { width: 78px; height: 78px; background: var(--clr-dark); border-color: var(--clr-dark); }
.cursor-ring.is-view .cursor-ring__label { opacity: 1; transform: scale(1); }
.cursor-dot.is-hidden { opacity: 0 !important; }
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none !important; } }

/* Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-pop));
  z-index: 1002;
  transition: width 0.08s linear;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 2rem;
  font-family: var(--ff-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1.5px solid transparent;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out-expo), background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.btn--primary { background: var(--clr-accent); color: #fff; border-color: var(--clr-accent); }
.btn--primary:hover {
  background: var(--clr-accent-pop);
  border-color: var(--clr-accent-pop);
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.28);
}
.btn--outline { background: transparent; color: var(--clr-accent); border-color: var(--clr-accent); }
.btn--outline:hover { background: var(--clr-accent); color: #fff; }
.btn--ghost { background: transparent; color: var(--clr-text-muted); padding-inline: 1.25rem; }
.btn--ghost:hover { color: var(--clr-accent-pop); }
.btn--small { padding: 0.6rem 1.25rem; font-size: 0.72rem; }
.btn--full { width: 100%; }

/* Section Headers */
.section__header { text-align: left; margin-bottom: 3rem; }
.section__header--left { text-align: left; }
.section__label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--clr-accent-pop);
  margin-bottom: 0.65rem;
}
.section__title {
  font-family: var(--ff-heading);
  font-size: clamp(2.1rem, 4.4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 0.85rem;
}
.section__subtitle { font-size: 1.02rem; color: var(--clr-text-muted); max-width: 560px; }

/* Scroll Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(34px) scale(0.985);
  transition: opacity 0.75s ease, transform 0.8s var(--ease-out-expo);
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0) scale(1); }
