/* ===== Tokens ===== */
:root {
  --navy: #041e3f;
  --navy-2: #0a2c58;
  --accent: #2f7bff;        /* icons, borders, decoration */
  --accent-2: #22d3ee;
  --accent-text: #1a5fe0;   /* accent used for small text: 5.6:1 on white */
  --btn-from: #2563eb;      /* white button label stays above 4.5:1 */
  --btn-to: #1d4ed8;

  --bg: #ffffff;
  --bg-alt: #f4f5f7;
  --surface: #ffffff;
  --text: #0b1a2e;
  --muted: #5a6779;
  --border: #e3e7ee;
  --step-num: #d9dfe8;
  --shadow: 0 1px 2px rgb(4 30 63 / .04), 0 8px 24px rgb(4 30 63 / .06);
  --shadow-lg: 0 2px 4px rgb(4 30 63 / .05), 0 20px 48px rgb(4 30 63 / .12);
  --focus: var(--accent);

  /* Partner logos are opaque images on white */
  --logo-tile: #ffffff;
  --logo-blend: normal;
  --logo-filter: grayscale(1) brightness(1.1);
  --logo-filter-active: none;

  --radius: 20px;
  --header-h: 68px;
  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent-text: #6aa5ff;
    --bg: #06111f;
    --bg-alt: #0a1a2e;
    --surface: #0e2038;
    --text: #e8eef7;
    --muted: #93a3ba;
    --border: #1c3150;
    --step-num: #22395a;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 20px 48px rgb(0 0 0 / .4);

    /* Invert the logos and screen-blend them so the white background disappears */
    --logo-tile: var(--surface);
    --logo-blend: screen;
    --logo-filter: grayscale(1) invert(1) brightness(.75);
    --logo-filter-active: grayscale(1) invert(1);

    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration: none; touch-action: manipulation; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
address { font-style: normal; }

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

.skip-link {
  position: absolute; z-index: 20;
  left: var(--gutter); top: -100px;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--navy);
  background: #fff;
}
.skip-link:focus { top: calc(env(safe-area-inset-top) + 12px); }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline:
    max(var(--gutter), env(safe-area-inset-left))
    max(var(--gutter), env(safe-area-inset-right));
}

.icon {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

.eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 12px;
}

.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--muted);
  max-width: 40ch;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-text { white-space: nowrap; }

/* Dark blocks (header, hero, contact card) */
.site-header, .hero, .contact { --focus: var(--accent-2); }
.hero .eyebrow, .contact .eyebrow { color: var(--accent-2); }
.hero .lead, .contact .lead { color: rgb(255 255 255 / .75); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform .2s, scale .1s, box-shadow .2s, background-color .2s, border-color .2s;
}
.btn:active { scale: .97; }
.btn .icon { width: 18px; height: 18px; transition: transform .2s; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--btn-from), var(--btn-to));
  box-shadow: 0 8px 24px rgb(37 99 235 / .35);
}
.btn-ghost {
  color: #fff;
  border: 1px solid rgb(255 255 255 / .25);
  background: rgb(255 255 255 / .04);
}

/* ===== Header ===== */
.site-header {
  position: fixed; inset: 0 0 auto 0;
  z-index: 10;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  color: #fff;
  background: rgb(4 30 63 / .8);
  border-bottom: 1px solid rgb(255 255 255 / .08);
}
/* Blur sits on a pseudo-element: Safari 26 won't tint its status/toolbar area from a bar that has backdrop-filter */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.2rem; letter-spacing: -0.01em; }
.logo-text b { font-weight: 800; }
.logo-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.logo-mark .icon { width: 20px; height: 20px; stroke-width: 2; }

.nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 32px); font-size: .95rem; font-weight: 500; }
.nav a { opacity: .8; transition: opacity .2s, background-color .2s; }
.nav a:hover { opacity: 1; }
.nav .nav-cta {
  opacity: 1;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgb(255 255 255 / .1);
  border: 1px solid rgb(255 255 255 / .18);
}
.nav .nav-cta:hover { background: rgb(255 255 255 / .18); }

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(100svh, 820px);
  display: flex; align-items: center;
  padding-block: calc(var(--header-h) + env(safe-area-inset-top) + 64px) 96px;
  color: #fff;
  background: var(--navy);
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 60% at 85% 20%, rgb(47 123 255 / .45), transparent 70%),
    radial-gradient(50% 50% at 10% 90%, rgb(34 211 238 / .25), transparent 70%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / .05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
}
.hero-inner { position: relative; }
.hero h1 {
  font-size: clamp(2.75rem, 8vw, 5.5rem);
  font-weight: 800;
  max-width: 14ch;
}
.hero .lead { margin-top: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* ===== Sections ===== */
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: clamp(40px, 6vw, 64px); }
.section-head h2, .contact h2 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; max-width: 20ch; }

/* Services */
.cards { display: grid; gap: 24px; }
.card {
  padding: 36px 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: translate .25s, box-shadow .25s, border-color .25s;
}
.card-icon {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  margin-bottom: 28px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgb(47 123 255 / .3);
}
.card-icon .icon { width: 26px; height: 26px; }
.card h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 12px; }
.card p { color: var(--muted); }

/* Process */
.steps { display: grid; gap: 20px; }
.step {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color .25s;
}
.step-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; color: var(--accent); }
.step-top .icon { width: 28px; height: 28px; }
.step-num { font-size: 2.25rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--step-num); }
.step h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: .95rem; }

/* Partners */
.logos { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.logos li {
  display: grid; place-items: center;
  height: 180px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--logo-tile);
  border: 1px solid var(--border);
}
.logos img {
  max-height: 124px; width: auto;
  filter: var(--logo-filter);
  mix-blend-mode: var(--logo-blend);
  transition: filter .3s;
}

/* Contact */
.section-contact { padding-top: 0; scroll-margin-top: 24px; }
.contact {
  display: grid; gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  align-items: center;
  padding: clamp(32px, 6vw, 72px);
  border-radius: calc(var(--radius) + 8px);
  color: #fff;
  background:
    radial-gradient(70% 90% at 100% 0%, rgb(47 123 255 / .45), transparent 70%),
    linear-gradient(135deg, var(--navy), var(--navy-2));
}
.contact .lead { margin-top: 20px; }
.contact-list { display: grid; gap: 14px; }
.contact-item {
  display: flex; align-items: center; gap: 16px;
  min-width: 0;
  padding: 20px 24px;
  border-radius: 16px;
  background: rgb(255 255 255 / .06);
  border: 1px solid rgb(255 255 255 / .12);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 600;
  overflow-wrap: break-word;
  transition: background-color .2s, border-color .2s;
}
.contact-item .icon { color: var(--accent-2); }
.contact-item small {
  display: block;
  font-size: .75rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgb(255 255 255 / .6);
}

/* Footer */
.site-footer {
  padding-block: 32px max(32px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9rem;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer a:hover { color: var(--text); }

/* ===== Hover (mouse / trackpad only) ===== */
@media (hover: hover) {
  .btn:hover .icon { transform: translateX(3px); }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgb(37 99 235 / .45); }
  .btn-ghost:hover { border-color: rgb(255 255 255 / .6); background: rgb(255 255 255 / .1); }
  .card:hover { translate: 0 -4px; box-shadow: var(--shadow-lg); border-color: rgb(47 123 255 / .4); }
  .step:hover { border-color: rgb(47 123 255 / .4); }
  .logos li:hover img { filter: var(--logo-filter-active); }
  a.contact-item:hover { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .3); }
}
/* Touch screens can't hover, so show the logos in their final state right away */
@media (hover: none) {
  .logos img { filter: var(--logo-filter-active); }
}

/* ===== Layout breakpoints ===== */
/* Tablets: one card per row, icon beside the text */
@media (min-width: 641px) and (max-width: 899px) {
  .card { display: grid; grid-template-columns: auto 1fr; column-gap: 24px; }
  .card-icon { grid-row: span 2; margin-bottom: 0; }
}
@media (min-width: 641px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* Phones */
@media (max-width: 640px) {
  :root { --header-h: 60px; --radius: 16px; }

  .logo-text { display: none; }
  .logo-mark { width: 32px; height: 32px; }
  .nav { gap: 4px; font-size: .9rem; }
  .nav a { padding: 10px 8px; }
  .nav .nav-cta { padding: 7px 14px; margin-left: 4px; }

  .hero { min-height: auto; padding-block: calc(var(--header-h) + env(safe-area-inset-top) + 56px) 64px; }
  .hero h1 { font-size: clamp(2.5rem, 12vw, 3.5rem); }
  /* Always break before "with us!" so the headline doesn't depend on per-browser font metrics */
  .hero h1 .gradient-text { display: block; width: fit-content; }
  .hero .lead { margin-top: 16px; }
  .hero-actions { margin-top: 32px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }

  .section { padding-block: 64px; }
  .section-head { margin-bottom: 32px; }
  .cards, .steps { gap: 14px; }
  .card { padding: 24px; }
  .card-icon { width: 48px; height: 48px; margin-bottom: 18px; border-radius: 14px; }
  .card h3 { font-size: 1.2rem; margin-bottom: 8px; }
  .step { padding: 22px; }
  .step-top { margin-bottom: 14px; }
  .step-num { font-size: 1.75rem; }

  .logos { gap: 10px; }
  .logos li { height: 96px; padding: 14px; }
  .logos img { max-height: 64px; }

  .contact { gap: 28px; padding: 28px 20px; }
  .contact-item { padding: 16px 18px; gap: 14px; }
}

/* Very narrow phones: drop the least important menu item */
@media (max-width: 380px) {
  .nav-optional { display: none; }
}

/* ===== Motion ===== */
/* Cards fade in while scrolling (pure CSS; browsers without support simply show them) */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .card, .step, .logos li {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
