/* ============================================================
   KRYPTEX SOLUTIONS — GLOBAL DESIGN SYSTEM
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Background / Surface Hierarchy */
  --bg:                   #0a151a;
  --surface-low:          #121d23;
  --surface-mid:          #1a2830;
  --surface-high:         #2b363d;
  --surface-highest:      #3a474f;

  /* Brand Colors */
  --primary:              #bac8dc;
  --primary-dim:          #7ca9b6;
  --secondary:            #a7cdd5;
  --accent:               #ffb59e;   /* Coral — CTA ONLY */
  --accent-hover:         #ff9979;

  /* Text */
  --text-primary:         #f0f4f8;
  --text-secondary:       #8fa8b8;
  --text-muted:           #5c7a8a;
  --text-inverse:         #0a151a;

  /* Borders (ghost only) */
  --border-ghost:         rgba(186, 200, 220, 0.12);
  --border-focus:         rgba(186, 200, 220, 0.40);

  /* Spacing Scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Typography Scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* Font Families */
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  /* Borders & Radius */
  --radius-sm:  0.25rem;
  --radius-md:  0.5rem;
  --radius-lg:  0.75rem;
  --radius-xl:  1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Shadows (ambient only) */
  --shadow-sm:  0 4px 24px rgba(10, 21, 26, 0.4);
  --shadow-md:  0 8px 48px rgba(10, 21, 26, 0.5);
  --shadow-lg:  0 16px 64px rgba(10, 21, 26, 0.6);

  /* Nav height */
  --nav-height: 72px;

  /* Max content width */
  --max-w: 1280px;
  --max-w-text: 760px;
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }
input, textarea, select { font: inherit; }

/* ============================================================
   3. TYPOGRAPHY UTILITIES
   ============================================================ */
.font-display { font-family: var(--font-display); }
.font-body    { font-family: var(--font-body); }

.display-xl {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, var(--text-7xl));
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.display-lg {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, var(--text-6xl));
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.display-md {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, var(--text-5xl));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.headline-lg {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, var(--text-4xl));
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.headline-md {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, var(--text-3xl));
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.title-lg {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
}
.title-md {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.35;
}
.body-lg   { font-size: var(--text-lg); line-height: 1.7; }
.body-base { font-size: var(--text-base); line-height: 1.65; }
.body-sm   { font-size: var(--text-sm); line-height: 1.6; }
.label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Color utilities */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent); }
.text-brand     { color: var(--primary-dim); }

/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
@media (min-width: 640px) {
  .container { padding-inline: var(--space-8); }
}
@media (min-width: 1024px) {
  .container { padding-inline: var(--space-12); }
}

.section {
  padding-block: var(--space-20);
}
.section-lg {
  padding-block: var(--space-32);
}

/* Grid utilities */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }

@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 utilities */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.gap-2  { gap: var(--space-2); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }
.gap-12 { gap: var(--space-12); }

/* Spacing utilities */
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.pt-nav { padding-top: var(--nav-height); }

/* Alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.mx-auto     { margin-inline: auto; }

/* ============================================================
   5. BACKGROUND UTILITIES
   ============================================================ */
.bg-base    { background-color: var(--bg); }
.bg-low     { background-color: var(--surface-low); }
.bg-mid     { background-color: var(--surface-mid); }
.bg-high    { background-color: var(--surface-high); }

/* Gradient mesh (hero backgrounds) */
.bg-mesh {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(124, 169, 182, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(186, 200, 220, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 10% 60%, rgba(167, 205, 213, 0.06) 0%, transparent 60%);
}

.bg-mesh-subtle {
  background-color: var(--surface-low);
  background-image:
    radial-gradient(ellipse 60% 40% at 70% 20%, rgba(124, 169, 182, 0.08) 0%, transparent 60%);
}

/* ============================================================
   6. SECTION LABEL (Overline)
   ============================================================ */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-dim);
  margin-bottom: var(--space-4);
}
.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--primary-dim);
  flex-shrink: 0;
}

/* ============================================================
   7. SCROLL ANIMATIONS
   ============================================================ */
.fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.fade-in.visible { opacity: 1; }

/* Staggered children */
.stagger > * { transition-delay: calc(var(--i, 0) * 80ms); }

/* ============================================================
   8. MISC UTILITIES
   ============================================================ */
.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;
}
.rounded-full { border-radius: var(--radius-full); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-2xl  { border-radius: var(--radius-2xl); }

.w-full  { width: 100%; }
.h-full  { height: 100%; }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* Italic accent (for hero) */
.italic-accent {
  font-style: italic;
  color: var(--accent);
}
