/* ============================================================
   GLOBAL CSS — SHADMAN SAKIB KHAN PORTFOLIO
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --white: #FFFFFF;
  --off-white: #FAFAFA;
  --gray-50: #F6F6F6;
  --gray-100: #ECECEC;
  --gray-200: #D8D8D8;
  --gray-300: #BBBBBB;
  --gray-500: #888888;
  --gray-700: #444444;
  --black: #111111;

  --ai-blue: #4F7EFF;
  --ai-blue-light: #7AA3FF;
  --ai-blue-dark: #2D5EDF;
  --ai-purple: #7A5FFF;
  --ai-purple-light: #A28AFF;
  --ai-cyan: #00D4FF;
  --ai-pink: #FF6B9D;

  --gradient-blue: linear-gradient(135deg, #4F7EFF 0%, #7A5FFF 100%);
  --gradient-subtle: linear-gradient(180deg, #FFFFFF 0%, #F6F6F6 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(79,126,255,0.15) 0%, transparent 70%);

  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.08);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.10);
  --shadow-xl: 0 48px 96px rgba(0,0,0,0.12);
  --shadow-blue: 0 8px 32px rgba(79,126,255,0.25);
  --shadow-purple: 0 8px 32px rgba(122,95,255,0.25);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 36px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-height: 72px;
  --max-width: 1280px;
  --section-pad: clamp(80px, 10vw, 140px);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

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

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

button {
  cursor: none;
  border: none;
  background: none;
  font-family: inherit;
}

/* ── Custom Cursor ────────────────────────────────────────── */
#cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--ai-blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, background 0.2s ease;
  will-change: transform;
}

#cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 40px; height: 40px;
  border: 1.5px solid rgba(79,126,255,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease, border-color 0.2s ease;
  will-change: transform;
}

body.cursor-hover #cursor-dot {
  transform: translate(-50%, -50%) scale(1.5);
  background: var(--ai-purple);
}
body.cursor-hover #cursor-ring {
  width: 60px; height: 60px;
  border-color: rgba(122,95,255,0.4);
}

/* ── Scroll Progress Bar ──────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--gradient-blue);
  z-index: 99997;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.05s linear;
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 60px);
  z-index: 9000;
  transition: background var(--transition-normal), box-shadow var(--transition-normal);
}

.nav.scrolled {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--gray-100), var(--shadow-sm);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-dot {
  width: 8px; height: 8px;
  background: var(--gradient-blue);
  border-radius: 50%;
  display: inline-block;
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--gradient-blue);
  transition: width var(--transition-normal);
  border-radius: 2px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--black);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-normal);
  border-radius: inherit;
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: var(--black);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-primary::before {
  background: linear-gradient(135deg, var(--ai-blue), var(--ai-purple));
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-blue);
}

.btn-secondary {
  background: transparent;
  color: var(--black);
  border: 1.5px solid var(--gray-200);
}

.btn-secondary:hover {
  border-color: var(--ai-blue);
  color: var(--ai-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-ghost {
  background: var(--gray-50);
  color: var(--black);
}

.btn-ghost:hover {
  background: var(--gradient-blue);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1rem;
  border-radius: var(--radius-full);
}

/* ── Glass Card ───────────────────────────────────────────── */
.glass-card {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ── Section Styles ───────────────────────────────────────── */
.section {
  padding: var(--section-pad) clamp(20px, 5vw, 60px);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ai-blue);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  width: 20px; height: 1.5px;
  background: var(--ai-blue);
  border-radius: 2px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--black);
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--gray-500);
  max-width: 560px;
  line-height: 1.7;
  margin-top: 16px;
}

/* ── Gradient Text ────────────────────────────────────────── */
.gradient-text {
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Tag / Badge ──────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.tag-blue {
  background: rgba(79,126,255,0.1);
  color: var(--ai-blue);
  border: 1px solid rgba(79,126,255,0.2);
}

.tag-purple {
  background: rgba(122,95,255,0.1);
  color: var(--ai-purple);
  border: 1px solid rgba(122,95,255,0.2);
}

.tag-gray {
  background: var(--gray-50);
  color: var(--gray-700);
  border: 1px solid var(--gray-100);
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Scroll Reveal ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--gray-100);
  margin: 0 clamp(20px, 5vw, 60px);
}

/* ── Noise Overlay ────────────────────────────────────────── */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99996;
  opacity: 0.025;
  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)'/%3E%3C/svg%3E");
  background-size: 256px;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  padding: 60px clamp(20px, 5vw, 60px) 40px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-copy {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--gray-500);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--ai-blue);
}

/* ── Loading Screen ───────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.loading-bar-wrap {
  width: 200px;
  height: 2px;
  background: var(--gray-100);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  background: var(--gradient-blue);
  border-radius: 2px;
  width: 0;
  transition: width 0.4s ease;
}

.loading-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* ── Mobile Menu ──────────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.nav-hamburger:hover { background: var(--gray-50); }

.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile {
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px);
  padding: 24px clamp(20px, 5vw, 60px) 32px;
  border-bottom: 1px solid var(--gray-100);
  transform: translateY(-110%);
  transition: transform var(--transition-normal);
  z-index: 8999;
}

.nav-mobile.open {
  transform: translateY(0);
}

.nav-mobile ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-mobile ul a {
  display: block;
  padding: 12px 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--black);
  border-bottom: 1px solid var(--gray-100);
  transition: color var(--transition-fast);
}

.nav-mobile ul a:hover { color: var(--ai-blue); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .nav-hamburger { display: flex; }
  :root { --section-pad: clamp(60px, 8vw, 100px); }
}

/* ── Utility ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mt-64 { margin-top: 64px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.full-width { width: 100%; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}
