/* ============================================================
   JAY ESS ENTERPRISES — DESIGN SYSTEM
   Mobile-First | 320px → 3840px
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --navy:          #0F172A;
  --slate:         #1E293B;
  --charcoal:      #111827;
  --white:         #FFFFFF;
  --off-white:     #F8FAFC;
  --light-grey:    #F1F5F9;
  --mid-grey:      #CBD5E1;
  --text-muted:    #64748B;
  --text-body:     #334155;
  --text-heading:  #0F172A;

  --blue:          #2563EB;
  --blue-light:    #3B82F6;
  --blue-dark:     #1D4ED8;
  --amber:         #F59E0B;
  --amber-dark:    #D97706;
  --emerald:       #10B981;
  --red:           #EF4444;

  --endico-orange: #F97316;
  --king-red:      #DC2626;
  --king-black:    #1C1C1C;

  --surface-1:     #FFFFFF;
  --surface-2:     #F8FAFC;
  --surface-3:     #F1F5F9;
  --surface-card:  rgba(255,255,255,0.85);
  --border:        rgba(15,23,42,0.08);
  --border-strong: rgba(15,23,42,0.15);

  --glass-bg:      rgba(255,255,255,0.7);
  --glass-border:  rgba(255,255,255,0.3);
  --glass-shadow:  0 8px 32px rgba(15,23,42,0.12);
  --glass-blur:    blur(16px);

  --shadow-xs:  0 1px 2px rgba(15,23,42,0.06);
  --shadow-sm:  0 2px 8px rgba(15,23,42,0.08);
  --shadow-md:  0 4px 16px rgba(15,23,42,0.10);
  --shadow-lg:  0 8px 32px rgba(15,23,42,0.12);
  --shadow-xl:  0 16px 48px rgba(15,23,42,0.14);
  --shadow-2xl: 0 24px 64px rgba(15,23,42,0.18);
  --shadow-blue:  0 8px 32px rgba(37,99,235,0.25);
  --shadow-amber: 0 8px 32px rgba(245,158,11,0.25);

  --grad-navy:  linear-gradient(135deg,#0F172A 0%,#1E293B 100%);
  --grad-blue:  linear-gradient(135deg,#1D4ED8 0%,#3B82F6 100%);
  --grad-amber: linear-gradient(135deg,#D97706 0%,#F59E0B 100%);
  --grad-hero:  linear-gradient(180deg,rgba(15,23,42,0.3) 0%,rgba(15,23,42,0.7) 100%);
  --grad-card:  linear-gradient(135deg,rgba(255,255,255,0.9) 0%,rgba(241,245,249,0.8) 100%);

  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-full: 9999px;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-spec:    'IBM Plex Sans', sans-serif;

  --transition-fast:   150ms cubic-bezier(0.4,0,0.2,1);
  --transition-base:   250ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow:   400ms cubic-bezier(0.4,0,0.2,1);
  --transition-spring: 500ms cubic-bezier(0.34,1.56,0.64,1);

  --nav-height: 72px;
}

[data-theme="dark"] {
  --surface-1:    #0F172A;
  --surface-2:    #1E293B;
  --surface-3:    #111827;
  --surface-card: rgba(30,41,59,0.85);
  --off-white:    #1E293B;
  --light-grey:   #1E293B;
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.15);
  --text-body:    #CBD5E1;
  --text-heading: #F8FAFC;
  --text-muted:   #94A3B8;
  --glass-bg:     rgba(15,23,42,0.8);
  --glass-border: rgba(255,255,255,0.08);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.4);
  --grad-card:    linear-gradient(135deg,rgba(30,41,59,0.9) 0%,rgba(15,23,42,0.8) 100%);
}

/* ============================================================
   RESET & BASE — mobile-first
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--surface-1);
  color: var(--text-body);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color var(--transition-base), color var(--transition-base);
}

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

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* ============================================================
   TYPOGRAPHY — fluid, clamp-based
   ============================================================ */
.display-1 { font-family: var(--font-display); font-size: clamp(2rem,7vw,4.5rem);   font-weight: 700; line-height: 1.1;  letter-spacing: -0.03em; }
.display-2 { font-family: var(--font-display); font-size: clamp(1.75rem,5vw,3.5rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.display-3 { font-family: var(--font-display); font-size: clamp(1.375rem,4vw,2.5rem);font-weight: 600; line-height: 1.2;  letter-spacing: -0.02em; }
.heading-1  { font-family: var(--font-display); font-size: clamp(1.25rem,3vw,2rem);   font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.heading-2  { font-family: var(--font-display); font-size: clamp(1.125rem,2.5vw,1.5rem); font-weight: 600; line-height: 1.3; }
.heading-3  { font-family: var(--font-display); font-size: clamp(1rem,2vw,1.125rem);  font-weight: 600; line-height: 1.4; }
.body-lg    { font-size: clamp(1rem,2.5vw,1.125rem);   line-height: 1.7; }
.body-md    { font-size: clamp(0.9375rem,2vw,1rem);     line-height: 1.6; }
.body-sm    { font-size: clamp(0.8125rem,1.5vw,0.875rem); line-height: 1.5; }
.label      { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.mono       { font-family: var(--font-mono); }
.spec-text  { font-family: var(--font-spec); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

.container-narrow {
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 48px);
}

/* Section spacing — fluid */
.section    { padding-block: clamp(48px, 8vw, 120px); }
.section-sm { padding-block: clamp(32px, 5vw, 64px); }

/* ============================================================
   FLEX / GRID UTILITIES
   ============================================================ */
.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.flex-wrap      { flex-wrap: wrap; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.gap-6  { gap: 24px; }
.gap-8  { gap: 32px; }

/* Mobile-first grid: single column by default, expands at breakpoints */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: clamp(12px,3vw,24px); }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: clamp(12px,3vw,24px); }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: clamp(12px,3vw,24px); }

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

/* ============================================================
   TEXT UTILITIES
   ============================================================ */
.text-center  { text-align: center; }
.text-white   { color: #fff; }
.text-heading { color: var(--text-heading); }
.text-muted   { color: var(--text-muted); }
.text-blue    { color: var(--blue); }
.text-amber   { color: var(--amber); }

.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;
}

/* ============================================================
   GLASS CARD
   ============================================================ */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
}

/* ============================================================
   BUTTON SYSTEM — mobile-first touch targets
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: clamp(0.875rem, 2vw, 0.9375rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  min-height: 44px; /* WCAG touch target */
  text-decoration: none;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.btn:hover::after  { opacity: 1; }
.btn:active        { transform: scale(0.97); }

.btn-primary  { background: var(--grad-blue);  color: #fff; box-shadow: var(--shadow-blue); }
.btn-amber    { background: var(--grad-amber); color: #fff; box-shadow: var(--shadow-amber); }
.btn-outline  { background: transparent; color: var(--text-heading); border-color: var(--border-strong); }
.btn-ghost    { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.2); backdrop-filter: blur(8px); }
.btn-whatsapp { background: linear-gradient(135deg,#25D366,#128C7E); color: #fff; box-shadow: 0 8px 24px rgba(37,211,102,0.3); }
.btn-call     { background: linear-gradient(135deg,#10B981,#059669); color: #fff; box-shadow: 0 8px 24px rgba(16,185,129,0.3); }

.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(37,99,235,0.35); }
.btn-amber:hover    { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(245,158,11,0.35); }
.btn-outline:hover  { background: var(--surface-3); transform: translateY(-2px); }
.btn-ghost:hover    { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(37,211,102,0.4); }
.btn-call:hover     { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(16,185,129,0.4); }

.btn-sm   { padding: 8px 16px;  font-size: 0.875rem;   min-height: 38px; }
.btn-lg   { padding: 14px 28px; font-size: 1rem;        min-height: 48px; }
.btn-xl   { padding: 16px 32px; font-size: 1rem;        min-height: 52px; }
.btn-icon { padding: 10px; border-radius: var(--radius-full); min-height: 44px; min-width: 44px; }

/* Full-width helper */
.btn-block { width: 100%; }

/* ============================================================
   SECTION EYEBROW
   ============================================================ */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(37,99,235,0.1);
  color: var(--blue);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

[data-theme="dark"] .section-eyebrow {
  background: rgba(59,130,246,0.15);
  border-color: rgba(59,130,246,0.25);
  color: var(--blue-light);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-endico     { background: #F97316; color: #fff; }
.badge-king-red   { background: #DC2626; color: #fff; }
.badge-king-black { background: #1C1C1C; color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.badge-blue       { background: var(--blue);  color: #fff; }
.badge-amber      { background: var(--amber); color: #1C1C1C; }

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg,var(--surface-3) 25%,var(--surface-2) 50%,var(--surface-3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.fade-up.visible { opacity: 1; transform: translateY(0); }
.fade-up[data-delay="1"] { transition-delay: 0.1s; }
.fade-up[data-delay="2"] { transition-delay: 0.2s; }
.fade-up[data-delay="3"] { transition-delay: 0.3s; }
.fade-up[data-delay="4"] { transition-delay: 0.4s; }
.fade-up[data-delay="5"] { transition-delay: 0.5s; }
.fade-up[data-delay="6"] { transition-delay: 0.6s; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-logo {
  font-family: var(--font-display);
  color: #fff;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  text-align: center;
  padding-inline: 20px;
}
.loading-logo span { color: var(--amber); }
.loading-bar { width: clamp(120px, 50vw, 200px); height: 3px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.loading-bar-fill { height: 100%; background: var(--grad-blue); border-radius: 3px; animation: loading-fill 1.2s cubic-bezier(0.4,0,0.2,1) forwards; }
@keyframes loading-fill { 0% { width: 0%; } 60% { width: 75%; } 100% { width: 100%; } }

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: var(--grad-blue);
  color: #fff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-blue);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-base);
  z-index: 200;
  border: none;
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover   { transform: translateY(-4px); }

@media (min-width: 768px) {
  #back-to-top { right: 24px; width: 48px; height: 48px; }
}

/* ============================================================
   STICKY CTA BAR — mobile only
   ============================================================ */
#sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  padding: 10px 16px;
  z-index: 300;
  gap: 10px;
  box-sizing: border-box;
}

/* Show on mobile, hide on desktop */
@media (max-width: 768px) {
  #sticky-cta { display: flex; }
  #sticky-cta .btn { flex: 1; padding: 11px 8px; font-size: 0.8125rem; border-radius: var(--radius-lg); min-height: 44px; }
  body { padding-bottom: 72px; }
  #back-to-top { bottom: 88px; }
}

/* ============================================================
   CTA SECTION ACTIONS — stack on mobile
   ============================================================ */
.cta-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  width: 100%;
}
.cta-actions .btn { width: 100%; justify-content: center; }

@media (min-width: 480px) {
  .cta-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: auto;
  }
  .cta-actions .btn { width: auto; }
}
