/* ===== Design tokens ===== */
:root {
  --bg: #060b16;
  --bg-alt: #0a1220;
  --surface: #0f1b2e;
  --surface-2: #131f34;
  --border: rgba(148, 178, 214, 0.14);
  --text: #eaf1fb;
  --text-muted: #9fb1c9;
  --text-faint: #6b7d95;

  --blue: #1e5c8a;
  --blue-bright: #2f7fc4;
  --teal: #2dd4bf;
  --teal-bright: #5eead4;

  --gradient-brand: linear-gradient(135deg, var(--blue) 0%, var(--blue-bright) 45%, var(--teal) 100%);
  --gradient-text: linear-gradient(135deg, #7fc8e8 0%, var(--teal-bright) 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;

  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 0 1px rgba(94, 234, 212, 0.15), 0 20px 60px -20px rgba(45, 212, 191, 0.35);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 5rem;
  --space-7: 8rem;

  --max-width: 1180px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f8fc;
    --bg-alt: #ffffff;
    --surface: #ffffff;
    --surface-2: #eef3f9;
    --border: rgba(30, 60, 90, 0.12);
    --text: #101826;
    --text-muted: #47566b;
    --text-faint: #7c8ba1;
    --shadow-md: 0 10px 30px -14px rgba(20, 40, 70, 0.25);
    --shadow-glow: 0 0 0 1px rgba(45, 150, 160, 0.15), 0 20px 50px -24px rgba(30, 92, 138, 0.3);
  }
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.wrap {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

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

.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-2);
  z-index: 200;
  background: var(--teal);
  color: #05221d;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--transition);
}
.skip-link:focus {
  top: var(--space-2);
}

/* Consistent, visible focus ring everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--teal-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--gradient-brand);
  color: #04141f;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(94,234,212,0.25), 0 24px 60px -18px rgba(45,212,191,0.5); }

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

.btn-lg { padding: 0.9rem 1.8rem; font-size: 1.02rem; }

.btn-nav-cta { display: none; }
@media (min-width: 860px) {
  .btn-nav-cta { display: inline-flex; }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: 0.9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.brand img { border-radius: 50%; }
.brand-suffix { color: var(--text-faint); font-weight: 500; }

.site-nav { display: none; }
@media (min-width: 860px) {
  .site-nav { display: block; margin-inline: auto; }
  .site-nav ul { display: flex; gap: var(--space-4); }
  .site-nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--transition);
  }
  .site-nav a:hover { color: var(--teal-bright); }
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}
@media (min-width: 860px) {
  .nav-toggle { display: none; }
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: transform var(--transition);
}
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.mobile-nav ul { padding: var(--space-2) var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }
.mobile-nav a { display: block; padding: 0.4rem 0; font-weight: 500; }
@media (min-width: 860px) {
  .mobile-nav { display: none !important; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-7) var(--space-6);
}

.hero-bg {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 140%;
  background:
    radial-gradient(45% 55% at 18% 25%, rgba(47, 127, 196, 0.35), transparent 70%),
    radial-gradient(40% 50% at 82% 20%, rgba(45, 212, 191, 0.28), transparent 70%),
    radial-gradient(60% 60% at 50% 100%, rgba(30, 92, 138, 0.25), transparent 70%);
  filter: blur(10px);
  animation: drift 22s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2%, 3%, 0) scale(1.05); }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
  text-align: center;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 56ch;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ===== Trust strip ===== */
.trust {
  border-block: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: var(--space-4);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
@media (min-width: 720px) {
  .trust-grid { grid-template-columns: repeat(4, 1fr); }
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.trust-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--teal-bright);
}

/* ===== Section shared ===== */
.eyebrow {
  color: var(--teal-bright);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-1);
}
.services, .process { padding-block: var(--space-6); }
.services h2, .process h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 30ch;
}
.section-sub {
  color: var(--text-muted);
  margin-top: var(--space-1);
  max-width: 60ch;
  font-size: 1.02rem;
}

/* ===== Services cards ===== */
.card-grid {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(94, 234, 212, 0.35);
  box-shadow: var(--shadow-md);
}
.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: #04141f;
  margin-bottom: var(--space-2);
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 0.4rem; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Process timeline ===== */
.timeline {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  list-style: none;
  padding-left: 0;
}
@media (min-width: 760px) {
  .timeline { grid-template-columns: repeat(4, 1fr); }
}
.timeline li {
  position: relative;
  padding-top: var(--space-2);
  border-top: 2px solid var(--border);
}
.timeline-index {
  display: block;
  font-weight: 800;
  font-size: 1.4rem;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.3rem;
}
.timeline h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; }
.timeline p { color: var(--text-muted); font-size: 0.94rem; }

/* ===== Lead engineer ===== */
.lead { padding-block: var(--space-6); border-top: 1px solid var(--border); }
.lead-inner { display: flex; justify-content: center; }
.lead-copy { max-width: 760px; width: 100%; }
.lead-copy h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 30ch;
}

.lead-card {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
@media (min-width: 640px) {
  .lead-card { flex-direction: row; text-align: left; }
}

.lead-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.lead-name { font-size: 1.2rem; font-weight: 700; }
.lead-title {
  color: var(--teal-bright);
  font-weight: 600;
  font-size: 0.92rem;
  margin-top: 0.15rem;
}
.lead-desc {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-top: var(--space-2);
}

.lead-links {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}
@media (min-width: 640px) {
  .lead-links { justify-content: flex-start; }
}
.lead-links a {
  color: var(--teal-bright);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.lead-links a:hover { color: var(--text); }

.lead-quotes { margin-top: var(--space-4); }

.lead-quote-track {
  position: relative;
  min-height: 9.5rem;
}

.lead-quote {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--teal-bright);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 500ms ease, transform 500ms ease, visibility 0s linear 500ms;
}
.lead-quote.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 500ms ease, transform 500ms ease;
}
@media (prefers-reduced-motion: reduce) {
  .lead-quote { transition: opacity 0s, visibility 0s; }
}

.lead-quote p {
  font-style: italic;
  color: var(--text);
  font-size: 1rem;
}
.lead-quote footer {
  margin-top: var(--space-2);
  color: var(--text-faint);
  font-size: 0.86rem;
  font-weight: 600;
}

.lead-quote-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--space-3);
}
@media (min-width: 640px) {
  .lead-quote-dots { justify-content: flex-start; }
}
.lead-quote-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.lead-quote-dots button:hover { transform: scale(1.2); }
.lead-quote-dots button[aria-selected="true"] {
  background: var(--teal-bright);
}

/* ===== Contact ===== */
.contact {
  padding-block: var(--space-6);
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.contact-inner {
  display: flex;
  justify-content: center;
  text-align: center;
}
.contact-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 640px;
}
.contact-copy h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.contact-cta {
  margin-top: 2rem;
}

/* ===== Legal pages ===== */
.legal { padding-block: var(--space-6); }
.legal-inner { max-width: 760px; }
.legal-inner h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-top: 0.2rem;
}
.legal-updated {
  color: var(--text-faint);
  font-size: 0.88rem;
  margin-top: var(--space-1);
}
.legal-body {
  margin-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.legal-body h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: var(--space-2);
}
.legal-body p {
  color: var(--text-muted);
  font-size: 0.98rem;
}
.legal-body a {
  color: var(--teal-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-4);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  justify-content: space-between;
}
.brand-footer { font-size: 0.95rem; font-weight: 600; }
.footer-links { display: flex; gap: var(--space-3); }
.footer-links a, .footer-copy { color: var(--text-faint); font-size: 0.86rem; }
.footer-links a:hover { color: var(--teal-bright); }
.footer-social { display: flex; gap: 0.6rem; }
.footer-social a {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}
.footer-social a:hover { color: var(--teal-bright); border-color: var(--teal-bright); }
.footer-copy { width: 100%; order: 10; margin-top: var(--space-1); }
@media (min-width: 700px) {
  .footer-copy { width: auto; order: 0; margin-top: 0; }
}

/* ===== Reveal-on-scroll (progressive enhancement) ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
