/* =============================================================
   base.css — design tokens, reset, typography, layout, animation
   CH. Santhosh — AI & Digital Growth Specialist
   ============================================================= */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Surfaces */
  --bg:            #061321;
  --bg-2:          #0A1928;
  --card:          #0D1C2C;
  --card-2:        #102235;

  /* Lines */
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-blue:   rgba(22, 137, 245, 0.34);

  /* Accent */
  --blue:          #1689F5;
  --blue-bright:   #159BFF;
  --blue-soft:     rgba(22, 137, 245, 0.12);
  --blue-softer:   rgba(22, 137, 245, 0.06);
  --cyan:          #3FC8FF;

  /* Text */
  --white:         #FFFFFF;
  --text:          #E8EEF6;
  --text-2:        #A9B6C5;
  --text-3:        #718196;

  /* Type */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --container: 1280px;
  --gutter: 24px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --header-h: 84px;

  /* Shadows */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow: 0 18px 44px -20px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 42px 90px -34px rgba(0, 0, 0, 0.82);
  --shadow-blue: 0 22px 60px -26px rgba(21, 155, 255, 0.55);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.68, 0.32, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.6s;

  /* z-index scale */
  --z-bg: 0;
  --z-content: 1;
  --z-header: 80;
  --z-cursor: 120;
  --z-toast: 140;
}

/* ---------- 2. RESET ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: rgba(22, 137, 245, 0.45) var(--bg);
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button { background: none; border: 0; cursor: pointer; }

ul, ol { list-style: none; }

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--white);
  text-wrap: balance;
}

p { text-wrap: pretty; }

code {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0;
  color: var(--text-3);
}

::selection {
  background: rgba(21, 155, 255, 0.32);
  color: var(--white);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(22, 137, 245, 0.35);
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(22, 137, 245, 0.6); }

/* ---------- 3. A11Y HELPERS ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 4. LAYOUT ---------- */
.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(72px, 8vw, 118px);
  scroll-margin-top: var(--header-h);
}

.section__head {
  max-width: 720px;
  margin-bottom: clamp(40px, 4.5vw, 64px);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}
.section__head--center .eyebrow { justify-content: center; }

.section__title {
  font-size: clamp(2rem, 4.1vw, 3.1rem);
  font-weight: 800;
  margin-top: 16px;
}

.section__lead {
  margin-top: 20px;
  max-width: 62ch;
  color: var(--text-2);
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
  line-height: 1.75;
}

.lead {
  color: var(--text);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.72;
  font-weight: 500;
}

.grad-text {
  background: linear-gradient(104deg, #ffffff 0%, #9ecdfb 46%, var(--blue-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-bright);
}
.eyebrow--center { justify-content: center; }

.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-bright);
  box-shadow: 0 0 0 4px rgba(21, 155, 255, 0.15);
  animation: pulseDot 2.6s var(--ease) infinite;
}

/* ---------- 5. BACKDROP LAYERS ---------- */
.bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 76% 68% at 50% 42%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 76% 68% at 50% 42%, #000 20%, transparent 78%);
}

.bg-grid--hero {
  opacity: 0.85;
  animation: gridDrift 42s linear infinite;
}
.bg-grid--section {
  opacity: 0.5;
  animation: gridDrift 58s linear infinite reverse;
}
.bg-grid--cta {
  opacity: 0.7;
  animation: gridDrift 36s linear infinite;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, #000 10%, transparent 76%);
  mask-image: radial-gradient(ellipse 70% 90% at 50% 50%, #000 10%, transparent 76%);
}
.bg-grid--footer { opacity: 0.35; }

.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
  will-change: transform;
}

.glow--blue-a {
  width: 620px; height: 620px;
  top: -180px; right: -140px;
  background: radial-gradient(circle, rgba(22, 137, 245, 0.34) 0%, transparent 68%);
  animation: floatA 24s var(--ease) infinite;
}
.glow--blue-b {
  width: 540px; height: 540px;
  bottom: -220px; left: -160px;
  background: radial-gradient(circle, rgba(13, 108, 214, 0.28) 0%, transparent 70%);
  animation: floatB 28s var(--ease) infinite;
}
.glow--cyan {
  width: 380px; height: 380px;
  top: 34%; left: 46%;
  background: radial-gradient(circle, rgba(63, 200, 255, 0.14) 0%, transparent 72%);
  animation: floatC 20s var(--ease) infinite;
}
.glow--cta-a {
  width: 760px; height: 500px;
  top: 50%; left: 50%;
  translate: -50% -50%;
  background: radial-gradient(ellipse, rgba(22, 137, 245, 0.36) 0%, transparent 70%);
  animation: glowBreathe 14s ease-in-out infinite;
}
.glow--cta-b {
  width: 460px; height: 460px;
  top: 12%; left: 8%;
  background: radial-gradient(circle, rgba(63, 200, 255, 0.16) 0%, transparent 72%);
  animation: floatB 22s var(--ease) infinite;
}

.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(21, 155, 255, 0.5), transparent 70%);
  filter: blur(1px);
  will-change: transform;
}
.orb--1 { width: 5px;  height: 5px;  top: 24%; left: 14%; animation: orbFloat 17s ease-in-out infinite; }
.orb--2 { width: 4px;  height: 4px;  top: 66%; left: 8%;  animation: orbFloat 21s ease-in-out infinite reverse; }
.orb--3 { width: 6px;  height: 6px;  top: 38%; left: 82%; animation: orbFloat 19s ease-in-out infinite; opacity: 0.75; }
.orb--4 { width: 3px;  height: 3px;  top: 78%; left: 68%; animation: orbFloat 25s ease-in-out infinite reverse; opacity: 0.6; }

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 6. SCROLL REVEAL ---------- */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
  will-change: opacity, transform;
}
.js .reveal.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

/* ---------- 7. KEYFRAMES ---------- */
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 64px 64px, 64px 64px; }
}

@keyframes floatA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-46px, 42px, 0) scale(1.09); }
}
@keyframes floatB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(54px, -38px, 0) scale(1.12); }
}
@keyframes floatC {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  50%      { transform: translate3d(34px, -30px, 0) scale(1.16); opacity: 1; }
}
@keyframes glowBreathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.78; }
  50%      { transform: translate(-50%, -50%) scale(1.16); opacity: 1; }
}
@keyframes orbFloat {
  0%, 100% { transform: translate3d(0, 0, 0);       opacity: 0.35; }
  50%      { transform: translate3d(18px, -30px, 0); opacity: 0.95; }
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(21, 155, 255, 0.16); }
  50%      { box-shadow: 0 0 0 7px rgba(21, 155, 255, 0.04); }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}
@keyframes arrowNudge {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(4px); }
}
@keyframes marqueeSlide {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
@keyframes scanLine {
  0%   { transform: translateY(-10%); opacity: 0; }
  12%  { opacity: 0.6; }
  88%  { opacity: 0.6; }
  100% { transform: translateY(110%); opacity: 0; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 8. RESPONSIVE GRID GUARDS ---------- */
@media (max-width: 1023px) {
  :root { --header-h: 74px; }
}

@media (max-width: 860px) {
  :root { --gutter: 20px; }
}

@media (max-width: 560px) {
  :root { --gutter: 18px; --radius-lg: 18px; }
}

/* ---------- 9. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal,
  .js [data-hero] {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Skill bars and counters should show their final value immediately. */
  .js .skill__fill {
    transition: none !important;
    width: var(--pct) !important;
  }
}

/* ---------- 10. PRINT ---------- */
@media print {
  .site-header, .cursor, .to-top, .hero__bg, .grain, .cta__bg,
  .bg-grid, .glow, .orb, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 24px; }
}
