/* ============================================================
   PTECH MEDIA — GLOBAL STYLES
   main.css: Variables, Reset, Typography, Utilities, Animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── CSS Custom Properties ─────────────────────────────── */
:root {
  /* Colors */
  --color-bg:          #050a18;
  --color-surface:     #0d1526;
  --color-surface-2:   #111e35;
  --color-surface-3:   #162040;
  --color-border:      rgba(99, 102, 241, 0.18);
  --color-border-soft: rgba(255, 255, 255, 0.07);

  /* Primary / Accent */
  --color-primary:     #6366f1;
  --color-primary-h:   #4f52e0;
  --color-accent:      #8b5cf6;
  --color-accent-2:    #a78bfa;
  --color-teal:        #06b6d4;

  /* Gradients */
  --gradient-primary:  linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --gradient-hero:     radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.28) 0%, transparent 70%),
                       radial-gradient(ellipse 60% 50% at 80% 30%, rgba(139,92,246,0.18) 0%, transparent 60%),
                       radial-gradient(ellipse 50% 40% at 10% 70%, rgba(6,182,212,0.12) 0%, transparent 55%);
  --gradient-card:     linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);

  /* Text */
  --color-text:        #f1f5f9;
  --color-text-muted:  #94a3b8;
  --color-text-subtle: #64748b;

  /* Spacing */
  --spacing-xs:   0.5rem;
  --spacing-sm:   1rem;
  --spacing-md:   1.5rem;
  --spacing-lg:   2.5rem;
  --spacing-xl:   4rem;
  --spacing-2xl:  6rem;

  /* Border Radius */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card:    0 0 0 1px var(--color-border), 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:    0 0 40px rgba(99, 102, 241, 0.25);
  --shadow-glow-sm: 0 0 20px rgba(99, 102, 241, 0.15);

  /* Transitions */
  --transition-fast:   all 0.15s ease;
  --transition-base:   all 0.3s ease;
  --transition-slow:   all 0.5s ease;
  --transition-spring: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --container-max: 1200px;
  --navbar-h:      76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--navbar-h);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

ul, ol {
  list-style: none;
}

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

/* ─── Container ─────────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
}

h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p {
  color: var(--color-text-muted);
  line-height: 1.8;
}

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

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition-base);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.55);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1.05rem;
}

/* ─── Section ───────────────────────────────────────────── */
.section {
  padding: var(--spacing-2xl) 0;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--color-accent-2);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.section-header h2 {
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Glass Card ────────────────────────────────────────── */
.glass-card {
  background: var(--gradient-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  transition: var(--transition-base);
}

.glass-card:hover {
  border-color: var(--color-border);
  box-shadow: var(--shadow-card);
  transform: translateY(-4px);
}

/* ─── Divider ───────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
  margin: var(--spacing-lg) 0;
}

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

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

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.3); }
  50%       { box-shadow: 0 0 40px rgba(99,102,241,0.6); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

.animate-fade-up {
  animation: fadeInUp 0.7s ease forwards;
}

.animate-float {
  animation: float 5s ease-in-out infinite;
}

/* ─── Scroll-triggered Reveal ───────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s 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; }

/* ─── Background Mesh ───────────────────────────────────── */
.mesh-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(99,102,241,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(139,92,246,0.06) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 50% 50%, rgba(6,182,212,0.04) 0%, transparent 50%);
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 3px;
}

/* ─── Selection ─────────────────────────────────────────── */
::selection {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
}

/* ─── Responsive Utilities ──────────────────────────────── */

/* Ensure all interactive elements meet 44px touch target min */
a, button, [role="button"], input, select, textarea {
  touch-action: manipulation;
}

/* Tablet ≤ 900px */
@media (max-width: 900px) {
  .container {
    padding: 0 1.25rem;
  }

  .section {
    padding: 4.5rem 0;
  }

  .section-header {
    margin-bottom: 3rem;
  }
}

/* Mobile ≤ 768px */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }

  :root {
    --navbar-h: 66px;
  }

  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section-header {
    margin-bottom: 2.5rem;
    text-align: left;
  }

  .section-header h2 {
    font-size: clamp(1.5rem, 6.5vw, 2rem);
  }

  .section-header p {
    font-size: 0.9rem;
    margin: 0;
  }

  /* Center section headers that are inside the centered wrapper */
  .section-header.text-center,
  #services .section-header,
  #platforms .section-header,
  #stats .section-header,
  #cta .section-header {
    text-align: center;
  }

  .section-badge {
    font-size: 0.72rem;
    padding: 0.3rem 0.85rem;
  }

  /* Buttons: minimum 44px height touch target */
  .btn {
    min-height: 44px;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 0.95rem;
  }

  /* Divider */
  .divider {
    margin: 1.25rem 0;
  }

  /* Glass card */
  .glass-card:hover {
    transform: none; /* disable hover lift on touch */
  }

  /* Reduce animation delays on mobile */
  .reveal-delay-1,
  .reveal-delay-2,
  .reveal-delay-3,
  .reveal-delay-4 {
    transition-delay: 0.05s;
  }
}

/* Small phones ≤ 480px */
@media (max-width: 480px) {
  .container {
    padding: 0 0.875rem;
  }

  .section {
    padding: 3rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .btn {
    font-size: 0.875rem;
    padding: 0.7rem 1.25rem;
  }
}

/* Extra small ≤ 375px */
@media (max-width: 375px) {
  .container {
    padding: 0 0.75rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .btn {
    font-size: 0.85rem;
    padding: 0.65rem 1.1rem;
  }
}

/* Desktop */
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  /* Prevent bounce scroll on iOS */
  body {
    -webkit-overflow-scrolling: touch;
  }

  /* Fix iOS input zoom (font-size must be >= 16px) */
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
