/* ==========================================================================
   NovaTech Design System — "Precision Systems"
   A deliberate identity for an enterprise ERP / systems-integration
   consultancy: deep structural navy, a single signal-blue accent sampled
   from the NovaTech mark, a geometric display face for authority, an
   engineered body/mono pairing for technical credibility, and a recurring
   "reticle" corner-bracket mark (echoing the lens/target dot in the logo's
   O) used to frame photography and key surfaces. Light page background;
   navy is used with intent — nav, footer, CTA — never as decoration.
   ========================================================================== */

:root {
  color-scheme: light;

  /* ---- Brand accent — sampled from the NovaTech mark. Every blue below is
     a controlled tint/shade of this single hue. ---- */
  --color-primary: #3E58F0;
  --color-primary-dark: #2439B8;
  --color-primary-light: #3E58F0;
  --color-primary-solid: #3E58F0;
  --color-primary-rgb: 62, 88, 240;
  --color-primary-soft: rgba(62, 88, 240, 0.08);
  --color-primary-soft-strong: rgba(62, 88, 240, 0.15);

  /* ---- Structural navy — the second half of the identity. Used with
     intent on the nav, footer and CTA bands, never as ambient decoration. ---- */
  --color-dark-navy: #0E1630;
  --color-dark-navy-2: #16204A;
  --color-dark-navy-rgb: 14, 22, 48;

  /* ---- Neutral scale — cool, faintly blue-tinted grays that key off the
     navy rather than true black, so the whole system reads as one family. ---- */
  --color-background: #FCFCFB;
  --color-background-alt: #F1F2F7;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F1F2F7;
  --color-border: #E2E4ED;
  --color-border-strong: #CBCFDE;
  --color-border-hover: #A9AFC6;

  --color-text: #1B2032;
  --color-text-strong: #0E1630;
  --color-muted: #5B6178;
  --color-muted-2: #83889C;

  --color-success: #128A6C;
  --color-warning: #AD7318;
  --color-danger: #C13A31;

  --shadow-sm: 0 1px 2px rgba(14, 22, 48, 0.07);
  --shadow-md: 0 10px 26px rgba(14, 22, 48, 0.10);
  --shadow-lg: 0 20px 48px rgba(14, 22, 48, 0.14);

  /* Sharper, engineered corners — instrument panel, not bubbly SaaS UI. */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 7px;
  --radius-full: 999px;

  /* Display: geometric, technical authority for headlines.
     Body: an engineered humanist sans (originally cut for IBM's systems)
     — a deliberate nod to the enterprise-software subject matter.
     Mono: data/label voice for eyebrows, numerals, tags. */
  --font-display: "Space Grotesk", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --container-width: 1240px;
  --nav-height: 80px;
  --section-spacing: clamp(64px, 9vw, 128px);

  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 160ms var(--ease-standard);
  --transition-base: 260ms var(--ease-standard);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

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

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--color-text-strong);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.12;
}
h1 { font-size: clamp(2.3rem, 3.7vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.8rem, 2.6vw, 2.5rem); font-weight: 600; }
h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); }
h4 { font-size: 1.15rem; }
p { margin: 0; color: var(--color-muted); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--color-primary);
  flex-shrink: 0;
}

.lead { font-size: 1.15rem; color: var(--color-muted); }
.text-muted { color: var(--color-muted); }
.text-strong { color: var(--color-text-strong); }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 24px;
}
.section { padding-block: var(--section-spacing); }
.section-alt { background: var(--color-background-alt); }
.section-header { max-width: 720px; margin-bottom: 48px; }
.section-header.center { margin-inline: auto; text-align: center; }
.section-header h2 { margin-top: 14px; }
.section-header p { margin-top: 16px; }

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

/* Cascade the scroll-reveal of card grids instead of every card fading in at once. */
.grid > .reveal:nth-child(1) { transition-delay: 0ms; }
.grid > .reveal:nth-child(2) { transition-delay: 70ms; }
.grid > .reveal:nth-child(3) { transition-delay: 140ms; }
.grid > .reveal:nth-child(4) { transition-delay: 210ms; }
.grid > .reveal:nth-child(5) { transition-delay: 280ms; }
.grid > .reveal:nth-child(6) { transition-delay: 350ms; }
.grid > .reveal:nth-child(n+7) { transition-delay: 420ms; }

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--color-primary-solid);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-primary-dark); box-shadow: var(--shadow-md); }

.btn-outline {
  background: transparent;
  color: var(--color-text-strong);
  border-color: var(--color-border-strong);
}
.btn-outline:hover { border-color: var(--color-primary); background: rgba(var(--color-primary-rgb), 0.08); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--color-text);
}
.btn-ghost:hover { color: var(--color-primary); }

.btn-sm { padding: 9px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ---- Cards ---- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-lg);
}
.card-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  margin-bottom: 20px;
}
.card-icon svg { width: 24px; height: 24px; }

/* ---- Badges / tags ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}
.badge-primary {
  background: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
  border-color: transparent;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text-strong);
}
.form-control, .form-select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft-strong);
}
.form-control:disabled, .form-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--color-surface-alt);
}
.form-control::placeholder { color: var(--color-muted-2); }
textarea.form-control { resize: vertical; min-height: 130px; }
.form-check { display: flex; align-items: flex-start; gap: 10px; }
.form-check input { margin-top: 4px; }
.form-check label { font-size: 0.88rem; color: var(--color-muted); }
.field-validation-error, .text-danger { color: var(--color-danger); font-size: 0.82rem; display: block; margin-top: 6px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; color: var(--color-danger); }

/* ---- Utility ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-standard), transform 700ms var(--ease-standard); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---- Signature mark — reticle corners ----
   A recurring precision-framing device (four hairline corner brackets, one
   tipped with the accent dot from the NovaTech mark) applied to photography
   and key bounded surfaces via .reticle. Keeps illustration/decoration to
   this one deliberate motif instead of scattering effects. */
.reticle { position: relative; }
.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 2;
}
.reticle::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--color-primary);
  border-left: 2px solid var(--color-primary);
}
.reticle::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--color-primary);
  border-right: 2px solid var(--color-primary);
}
.reticle .reticle-dot {
  position: absolute; top: -5px; left: -5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--color-primary); z-index: 3;
}

/* ---- Focus visibility (keyboard navigation) ---- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
input:not(.form-control):focus-visible,
select:not(.form-select):focus-visible,
textarea:not(.form-control):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 4px;
}
