/* ========================================================================== */
/*  Variables                                                                 */
/* ========================================================================== */

:root {
  /* Color Palette ---------------------------------------------------------- */
  --color-bg: #0f172a; /* deep navy background */
  --color-surface: #111827; /* slightly lighter surface */
  --color-surface-alt: #020617; /* darker alt surface */

  --color-text: #e5e7eb; /* main text */
  --color-text-muted: #9ca3af; /* secondary text */
  --color-border-subtle: #1f2937;

  --color-primary: #2563eb; /* engineering blue */
  --color-primary-soft: rgba(37, 99, 235, 0.14);
  --color-primary-strong: #1d4ed8;

  --color-success: #22c55e;
  --color-warning: #facc15;
  --color-danger: #ef4444;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography ------------------------------------------------------------- */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", 
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, 
    "Liberation Mono", "Courier New", monospace;

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

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

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

  /* Radius ----------------------------------------------------------------- */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* Shadows ---------------------------------------------------------------- */
  --shadow-subtle: 0 10px 30px rgba(15, 23, 42, 0.45);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.55);
  --shadow-hard: 0 0 0 1px rgba(15, 23, 42, 0.9),
    0 20px 60px rgba(15, 23, 42, 0.85);

  /* Transitions ------------------------------------------------------------ */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 240ms ease-out;
}

/* ========================================================================== */
/*  Reset / Normalize                                                         */
/* ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: none;
  background: none;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* Improved text rendering for a precise, technical aesthetic */
body,
input,
button,
textarea,
select {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================================================== */
/*  Base Styles                                                               */
/* ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background-color: var(--color-bg);
  color: var(--color-text);
}

main {
  min-height: 60vh;
}

/* Headings: clear hierarchy and technical precision ----------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: #f9fafb;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2.5rem, 3.5vw, var(--font-size-5xl));
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(2rem, 2.6vw, var(--font-size-4xl));
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.5rem, 2vw, var(--font-size-3xl));
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

small {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Links -------------------------------------------------------------------- */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base),
    text-decoration-color var(--transition-base),
    background-color var(--transition-base);
}

a:hover {
  color: var(--color-primary-strong);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Code --------------------------------------------------------------------- */

code,
pre {
  font-family: var(--font-mono);
}

/* ========================================================================== */
/*  Accessibility                                                             */
/* ========================================================================== */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

:focus {
  outline: none;
}

/* Respect prefers-reduced-motion ------------------------------------------ */

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

/* Screen reader only utility ---------------------------------------------- */

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

.sr-only-focusable:focus,
.sr-only-focusable:focus-visible {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ========================================================================== */
/*  Layout Utilities                                                          */
/* ========================================================================== */

/* Container for consistent max-width and padding -------------------------- */

.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  max-width: 1120px;
}

@media (min-width: 1280px) {
  .container {
    max-width: 1200px;
  }
}

/* Flex helpers ------------------------------------------------------------- */

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-row {
  flex-direction: row;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--space-3);
}

.gap-md {
  gap: var(--space-4);
}

.gap-lg {
  gap: var(--space-6);
}

/* Grid helpers ------------------------------------------------------------- */

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

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

/* Alignment & spacing utilities ------------------------------------------- */

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

.text-right {
  text-align: right;
}

.mt-0 {
  margin-top: 0;
}

.mt-sm {
  margin-top: var(--space-3);
}

.mt-md {
  margin-top: var(--space-6);
}

.mt-lg {
  margin-top: var(--space-10);
}

.mb-0 {
  margin-bottom: 0;
}

.mb-sm {
  margin-bottom: var(--space-3);
}

.mb-md {
  margin-bottom: var(--space-6);
}

.mb-lg {
  margin-bottom: var(--space-10);
}

.pt-section {
  padding-top: var(--space-16);
}

.pb-section {
  padding-bottom: var(--space-16);
}

@media (max-width: 768px) {
  .pt-section {
    padding-top: var(--space-12);
  }

  .pb-section {
    padding-bottom: var(--space-12);
  }
}

/* ========================================================================== */
/*  Components                                                                */
/* ========================================================================== */

/* Button: precise, modern primary call-to-action --------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

.button-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
  color: #f9fafb;
  box-shadow: 0 16px 35px rgba(37, 99, 235, 0.35);
}

.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.5);
  color: #f9fafb;
}

.button-primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.4);
}

.button-outline {
  background-color: rgba(15, 23, 42, 0.7);
  color: var(--color-text);
  border-color: var(--color-border-subtle);
}

.button-outline:hover {
  border-color: var(--color-primary);
  background-color: rgba(15, 23, 42, 0.9);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.button:focus-visible {
  outline: 2px solid #fbbf24;
  outline-offset: 3px;
}

/* Inputs: consistent, neutral, and accessible ------------------------------ */

.input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition: border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft);
  background-color: rgba(15, 23, 42, 0.98);
}

.input[disabled],
select[disabled],
textarea[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

label {
  display: inline-block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* Card: structural panels for services, case studies, testimonials -------- */

.card {
  position: relative;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 55%),
    var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: var(--space-6);
  box-shadow: var(--shadow-subtle);
  backdrop-filter: blur(18px);
}

.card--compact {
  padding: var(--space-4);
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-body {
  font-size: var(--font-size-sm);
}

/* Tag / badge for status or sectors --------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  font-size: var(--font-size-xs);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--color-text-muted);
  background: rgba(15, 23, 42, 0.9);
}

.badge--primary {
  border-color: rgba(37, 99, 235, 0.5);
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.14);
}

/* Subtle section dividers -------------------------------------------------- */

.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(148, 163, 184, 0.35),
    transparent
  );
  margin: var(--space-10) 0;
}

/* Hero text refinement for engineering precision -------------------------- */

.hero-eyebrow {
  font-size: var(--font-size-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.hero-lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

/* ========================================================================== */
/*  End of base.css                                                           */
/* ========================================================================== */
