/* ============================================================
   Renewit Solutions — Main CSS
   Variables · Reset · Typography · Utilities · Animations
   ============================================================ */

/* ── Google Fonts Preconnect (loaded in header.php) ── */

/* ── Design Tokens ──────────────────────────────────── */
:root {
  /* Palette */
  --navy:       #0F172A; /* Deep Slate 900 */
  --navy-light: #F8FAFC; /* Light Slate 50 */
  --navy-mid:   #1E293B; /* Slate 800 */
  --charcoal:   #FFFFFF; /* White */
  --slate:      #475569; /* Slate 600 */
  --steel:      #334155; /* Slate 700 */
  --smoke:      #64748B; /* Slate 500 */
  --silver:     #334155; /* Slate 700 */
  --mist:       #E2E8F0; /* Slate 200 */
  --off-white:  #F1F5F9; /* Slate 100 */
  --white:      #FFFFFF;

  /* Accent — A3 Digital Royal Blue */
  --teal:       #2563EB; /* Royal Blue */
  --teal-light: #3B82F6; /* Light Royal Blue */
  --teal-dark:  #1D4ED8; /* Dark Royal Blue */
  --teal-glow:  rgba(37, 99, 235, 0.08);

  /* Semantic */
  --bg-primary:   #F8FAFC; /* Light Slate background */
  --bg-secondary: #FFFFFF; /* White background for blocks */
  --bg-surface:   #FFFFFF; /* White surfaces */
  --bg-card:      #FFFFFF; /* White cards */
  --text-primary: #0F172A; /* Dark Slate text */
  --text-secondary: #475569; /* Slate secondary text */
  --text-muted:   #64748B; /* Muted text */
  --border:       #E2E8F0; /* Thin borders */
  --border-strong: #CBD5E1; /* Stronger borders */

  /* Grade Badges */
  --grade-a:    #22C55E;
  --grade-b:    #F59E0B;
  --grade-c:    #F97316;

  /* Spacing Scale */
  --sp-1:  0.25rem;   /* 4px  */
  --sp-2:  0.5rem;    /* 8px  */
  --sp-3:  0.75rem;   /* 12px */
  --sp-4:  1rem;      /* 16px */
  --sp-5:  1.25rem;   /* 20px */
  --sp-6:  1.5rem;    /* 24px */
  --sp-8:  2rem;      /* 32px */
  --sp-10: 2.5rem;    /* 40px */
  --sp-12: 3rem;      /* 48px */
  --sp-16: 4rem;      /* 64px */
  --sp-20: 5rem;      /* 80px */
  --sp-24: 6rem;      /* 96px */

  /* Typography */
  --font-sans: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */
  --text-6xl:  3.75rem;    /* 60px */

  --leading-tight:  1.25;
  --leading-snug:   1.375;
  --leading-normal: 1.6;
  --leading-relaxed:1.75;

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold:600;
  --weight-bold:    600;
  --weight-extrabold:600;

  /* Borders */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-xl:  0 20px 50px rgba(0,0,0,0.5);
  --shadow-teal:0 0 24px rgba(0, 201, 167, 0.25);

  /* Transitions */
  --ease-fast:   150ms ease;
  --ease-normal: 250ms ease;
  --ease-slow:   400ms ease;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --max-w-content: 1280px;
  --max-w-narrow:  800px;
  --header-h:      72px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol { list-style: none; }

button, input, textarea, select {
  font: inherit;
  border: none;
  outline: none;
  background: none;
}

button { cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

p { max-width: 65ch; }

table {
  border-collapse: collapse;
  width: 100%;
}

/* ── Focus Styles (Accessibility) ───────────────────── */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Typography Utilities ───────────────────────────── */
.text-xs   { font-size: var(--text-xs); }
.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }
.text-xl   { font-size: var(--text-xl); }
.text-2xl  { font-size: var(--text-2xl); }
.text-3xl  { font-size: var(--text-3xl); }

.font-medium   { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold     { font-weight: var(--weight-bold); }

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-teal      { color: var(--teal); }

.text-center { text-align: center; }
.text-left   { text-align: left; }

.uppercase { text-transform: uppercase; letter-spacing: 0.08em; }
.tracking-wide { letter-spacing: 0.05em; }

/* ── Section Label ──────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--sp-4);
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--teal);
  border-radius: 1px;
}

/* ── Section Heading ────────────────────────────────── */
.section-heading {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-4);
}

.section-heading .accent {
  color: var(--teal);
  position: relative;
}

.section-subtext {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 52ch;
}

/* ── Layout Utilities ───────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w-content);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

@media (max-width: 768px) {
  .container { padding-inline: var(--sp-4); }
}

.section {
  padding-block: var(--sp-20);
}

.section--sm { padding-block: var(--sp-12); }
.section--lg { padding-block: var(--sp-24); }

.grid {
  display: grid;
  gap: var(--sp-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* ── Button System ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: all var(--ease-normal);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--ease-fast);
  background: rgba(255,255,255,0.08);
}

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

.btn--primary {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}

.btn--primary:hover {
  background: var(--teal-light);
  border-color: var(--teal-light);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn--outline:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(37, 99, 235, 0.04);
  transform: translateY(-1px);
}

.btn--ghost {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
  border-color: transparent;
}

.btn--ghost:hover {
  background: rgba(0, 0, 0, 0.06);
}

.btn--whatsapp {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
}

.btn--whatsapp:hover {
  background: #1eb855;
  border-color: #1eb855;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.btn--sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--text-base);
}

/* WhatsApp icon inline */
.btn .icon-wa {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Divider ────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  border: none;
}

/* ── Badge ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
}

.badge--grade-a {
  background: rgba(34, 197, 94, 0.15);
  color: var(--grade-a);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge--grade-b {
  background: rgba(245, 158, 11, 0.15);
  color: var(--grade-b);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge--grade-c {
  background: rgba(249, 115, 22, 0.15);
  color: var(--grade-c);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

/* ── Skeleton Loaders ───────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.skeleton {
  background: var(--border);
  border-radius: var(--radius-md);
  animation: skeleton-pulse 1.8s ease-in-out infinite;
}

.skeleton-img  { aspect-ratio: 4/3; width: 100%; }
.skeleton-text { height: 1em; border-radius: var(--radius-sm); margin-block: var(--sp-2); }
.skeleton-text--sm  { width: 60%; }
.skeleton-text--md  { width: 80%; }
.skeleton-text--lg  { width: 100%; }
.skeleton-btn  { height: 40px; width: 140px; border-radius: var(--radius-md); }

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

.reveal.revealed {
  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; }

/* ── Circuit Line Background Texture ───────────────── */
.bg-circuit {
  position: relative;
  overflow: hidden;
}

.bg-circuit::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

.bg-circuit > * { position: relative; z-index: 1; }

/* ── Glow Orb ────────────────────────────────────────── */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.25;
}

.bg-glow--teal {
  background: radial-gradient(circle, var(--teal) 0%, transparent 70%);
}

.bg-glow--navy {
  background: radial-gradient(circle, var(--navy-mid) 0%, transparent 70%);
}

/* ── Gradient Text ───────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--white) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Utility Classes ─────────────────────────────────── */
.hidden   { display: none !important; }
.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;
}

.mt-auto { margin-top: auto; }
.w-full  { width: 100%; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
  background: var(--steel);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--smoke); }

/* ── Selection ───────────────────────────────────────── */
::selection {
  background: rgba(0, 201, 167, 0.3);
  color: var(--white);
}

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

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

/* ── Print ───────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { background: white; color: black; }
}
