/* ==========================================================================
   Nexient — Design system
   Brand colours are taken from the Nexient logo (#07459A primary,
   #43B7FF accent). The accent is reserved for graphics and dark
   backgrounds; it does not meet contrast requirements as text on white.
   ========================================================================== */

:root {
  /* Colour tokens */
  --brand: #07459a;
  --brand-dark: #053573;
  --brand-deep: #0a2a56;
  --accent: #43b7ff;
  --tint: #eaf3fe;
  --tint-soft: #f5f9fe;
  --ink: #0e1b2c;
  --ink-light: #35455c;
  --muted: #5b6b80;
  --bg: #ffffff;
  --card: #f8fafc;
  --border: #dde5ee;
  --success-bg: #e7f6ee;
  --success-ink: #14532d;
  --error-bg: #fdecec;
  --error-ink: #991b1b;

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(14, 27, 44, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(7, 69, 154, 0.18);
  --radius: 0.75rem;
  --radius-lg: 1rem;

  /* Type scale */
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --step-3: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  --step-4: clamp(2.25rem, 1.7rem + 2.4vw, 3.5rem);

  /* Spacing */
  --space-section: clamp(4rem, 3rem + 4vw, 7rem);
}

/* ---- Base ------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem; /* keep anchored sections clear of sticky header */
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--brand);
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 0;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding-inline: 1.5rem;
}

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

.section--tint {
  background: var(--tint-soft);
}

/* ---- Typography helpers ------------------------------------------------ */

.eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--tint);
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.section-heading {
  max-width: 640px;
  margin-bottom: 3rem;
}

.section-heading--center {
  margin-inline: auto;
  text-align: center;
}

.section-heading h2 {
  font-size: var(--step-3);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.85rem;
}

.section-heading p {
  font-size: var(--step-1);
  color: var(--ink-light);
}

/* ---- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px; /* comfortable touch target */
  padding: 0.75rem 1.6rem;
  border-radius: 0.55rem;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--brand-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn--secondary {
  background: #fff;
  color: var(--brand);
  border-color: var(--border);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.btn--light {
  background: #fff;
  color: var(--brand);
}

.btn--light:hover,
.btn--light:focus-visible {
  background: var(--tint);
  transform: translateY(-1px);
}

.btn[disabled] {
  opacity: 0.65;
  cursor: progress;
  transform: none;
}

/* ---- Header ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  height: 2.25rem;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a:not(.btn) {
  color: var(--ink-light);
  font-weight: 500;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:not(.btn):hover,
.nav-links a:not(.btn)[aria-current='true'] {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.nav-links .btn {
  min-height: 42px;
  padding: 0.5rem 1.2rem;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 12px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Hero -------------------------------------------------------------- */

.hero {
  background: linear-gradient(160deg, #f6faff 0%, #ffffff 55%, var(--tint) 100%);
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3rem;
  align-items: center;
  padding-block: var(--space-section);
}

.hero h1 {
  font-size: var(--step-4);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin-bottom: 1.4rem;
}

.hero .lede {
  font-size: var(--step-2);
  color: var(--ink-light);
  max-width: 34em;
  margin-bottom: 2.25rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-art {
  justify-self: center;
  width: min(100%, 420px);
}

/* Gentle pulse on the hero graphic nodes */
@keyframes node-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.hero-art .pulse {
  animation: node-pulse 4s ease-in-out infinite;
}

.hero-art .pulse:nth-of-type(2n) {
  animation-delay: 1.3s;
}

.hero-art .pulse:nth-of-type(3n) {
  animation-delay: 2.4s;
}

/* ---- Trust strip ------------------------------------------------------- */

.trust {
  border-block: 1px solid var(--border);
  background: #fff;
  padding-block: 1.75rem;
}

.trust-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  list-style: none;
}

.trust-items li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--ink-light);
  font-size: 0.95rem;
}

.trust-items svg {
  width: 1.4rem;
  height: 1.4rem;
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.trust-items strong {
  display: block;
  color: var(--ink);
}

/* ---- Service cards ------------------------------------------------------ */

.service-group {
  margin-bottom: 3.5rem;
}

.service-group:last-child {
  margin-bottom: 0;
}

.service-group > h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--step-2);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.service-group > h3 svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--brand);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.service-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.service-card > p {
  color: var(--ink-light);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.service-card details {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  font-size: 0.925rem;
}

.service-card summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 32px;
}

.service-card summary::-webkit-details-marker {
  display: none;
}

.service-card summary::after {
  content: '+';
  font-size: 1.2rem;
  line-height: 1;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.service-card details[open] summary::after {
  content: '−';
}

.service-card details dl {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.6rem;
}

.service-card details dt {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.service-card details dd {
  color: var(--ink-light);
  margin-bottom: 0.25rem;
}

/* ---- Integrated AI + security section ----------------------------------- */

.integrated {
  background: linear-gradient(150deg, var(--brand-deep) 0%, var(--brand) 90%);
  color: #fff;
}

.integrated .section-heading h2,
.integrated .section-heading p {
  color: #fff;
}

.integrated .section-heading p {
  opacity: 0.85;
}

.integrated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.integrated-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.integrated-card svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.integrated-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.integrated-card p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
}

/* ---- Outcomes ------------------------------------------------------------ */

.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.outcome-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.outcome-item svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.outcome-item strong {
  display: block;
  margin-bottom: 0.25rem;
}

.outcome-item span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---- Process timeline ------------------------------------------------------ */

.process-steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 0;
}

.process-steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 2.25rem 4rem;
}

.process-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.process-steps li::after {
  content: '';
  position: absolute;
  left: calc(1.375rem - 1px);
  top: 2.9rem;
  bottom: 0.35rem;
  width: 2px;
  background: var(--border);
}

.process-steps li:last-child {
  padding-bottom: 0;
}

.process-steps li:last-child::after {
  display: none;
}

.process-steps h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  padding-top: 0.4rem;
}

.process-steps p {
  color: var(--ink-light);
  max-width: 52em;
}

/* ---- Industries strip ------------------------------------------------------ */

.industries {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  list-style: none;
}

.industries li {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--ink-light);
}

/* ---- About ------------------------------------------------------------------ */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
}

.about-media img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  height: auto;
}

.about-content h2 {
  font-size: var(--step-3);
  font-weight: 800;
  margin-bottom: 1.15rem;
}

.about-content p {
  color: var(--ink-light);
  font-size: var(--step-1);
  margin-bottom: 1.15rem;
}

.about-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 0.85rem;
}

.values-list {
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.values-list li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--ink-light);
}

.values-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 2px;
  background: var(--accent);
}

.values-list strong {
  color: var(--ink);
}

/* ---- Contact / conversion ---------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3.5rem;
  align-items: start;
}

.contact-intro h2 {
  font-size: var(--step-3);
  font-weight: 800;
  margin-bottom: 1rem;
}

.contact-intro p {
  color: var(--ink-light);
  font-size: var(--step-1);
  margin-bottom: 1.5rem;
}

.contact-expect {
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.contact-expect li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: var(--ink-light);
}

.contact-expect svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.contact-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.35rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-group .hint {
  display: block;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea {
  min-height: 7rem;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(7, 69, 154, 0.15);
}

.form-group input:user-invalid,
.form-group select:user-invalid {
  border-color: var(--error-ink);
}

.form-message {
  display: none;
  padding: 1rem 1.15rem;
  border-radius: 0.5rem;
  font-weight: 500;
  margin-bottom: 1.35rem;
}

.form-message.show {
  display: block;
}

.form-message.success {
  background: var(--success-bg);
  color: var(--success-ink);
  border: 1px solid #b7e4c7;
}

.form-message.error {
  background: var(--error-bg);
  color: var(--error-ink);
  border: 1px solid #f5b5b5;
}

.privacy-note {
  margin-top: 1.15rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Honeypot field — hidden from people, visible to naive bots */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- Footer ---------------------------------------------------------------- */

.footer {
  background: var(--ink);
  color: #cbd5e1;
  padding-block: 3.5rem 2rem;
  font-size: 0.95rem;
}

.footer a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand img {
  height: 2rem;
  width: auto;
  margin-bottom: 1rem;
}

.footer-brand p {
  max-width: 34em;
  color: #94a3b8;
}

.footer h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.footer ul {
  list-style: none;
  display: grid;
  gap: 0.6rem;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 1.75rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* ---- Scroll reveal (progressively enhanced) ---------------------------------
   Elements are visible by default; JS adds .reveal-pending only to elements
   below the initial viewport, so content is never hidden if JS fails. */

.reveal {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.reveal-pending {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- 404 page ---------------------------------------------------------------- */

.error-page {
  min-height: 60vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding-block: var(--space-section);
}

.error-page h1 {
  font-size: var(--step-4);
  font-weight: 800;
  margin-bottom: 1rem;
}

.error-page p {
  color: var(--ink-light);
  font-size: var(--step-1);
  margin-bottom: 2rem;
}

/* ---- Legal pages -------------------------------------------------------------- */

.legal {
  max-width: 46rem;
}

.legal h1 {
  font-size: var(--step-3);
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.legal h2 {
  font-size: var(--step-2);
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

.legal p,
.legal li {
  color: var(--ink-light);
  margin-bottom: 0.85rem;
}

.legal ul {
  padding-left: 1.4rem;
}

/* ---- Responsive ---------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-art {
    order: -1;
    width: min(60%, 300px);
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 1rem 1.5rem 1.5rem;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-links a:not(.btn) {
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--border);
  }

  .nav-links .btn {
    margin-top: 0.75rem;
  }

  .hero-cta .btn {
    flex: 1 1 100%;
  }

  .contact-form {
    padding: 1.5rem;
  }
}

/* ---- Reduced motion -------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal.reveal-pending {
    opacity: 1;
    transform: none;
  }
}
