/* ==========================================================================
   XFinCom Apps — site styles
   ========================================================================== */

/* Fonts ------------------------------------------------------------------ */
@font-face {
  font-family: "Sofia Pro";
  src: url("../fonts/sofiapro-medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Pro";
  src: url("../fonts/sofiapro-semibold.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Pro";
  src: url("../fonts/sofiapro-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Pro";
  src: url("../fonts/sofiapro-black.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* Tokens ----------------------------------------------------------------- */
:root {
  --ink: #14161f;
  --ink-rgb: 20, 22, 31;
  --ink-contrast: #f5f6fb;
  --bg: #f5f6fb;
  --bg-deep: #eaecf8;
  --surface: #fff;
  --muted: #6b7280;
  --line: #d6d9e4;
  --accent: #4f46e5;
  --accent-rgb: 79, 70, 229;
  --accent-deep: #3730a3;
  --accent-x: #e11d48;
  --accent-soft: rgba(79, 70, 229, 0.1);

  --shell: 1200px;
  --gutter: 24px;
  --header-h: 76px;

  --font: "Sofia Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
figure,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Shared layout ---------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
}

.section {
  padding: 96px var(--gutter);
}

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

.section-head {
  max-width: 660px;
  margin-bottom: 52px;
}

.section-title {
  font-weight: 900;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-title .dot {
  color: var(--accent);
}

.section-lede {
  margin-top: 14px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease,
    border-color 150ms ease;
}

.btn--solid {
  background-color: var(--ink);
  color: var(--ink-contrast);
}

.btn--invert {
  background-color: var(--ink-contrast);
  color: var(--ink);
}

.btn--ghost {
  background-color: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--solid:hover,
.btn--invert:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -6px rgba(var(--ink-rgb), 0.35);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn--lg {
  min-height: 52px;
  padding-inline: 26px;
}

.btn--sm {
  min-height: 42px;
  padding-inline: 18px;
}

/* Logo ------------------------------------------------------------------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.logo-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  box-shadow: 0 2px 6px 0 rgba(var(--accent-rgb), 0.35);
}

/* Enclosed tile mark: self-contained, so it reads the same on the light
   header and the dark footer without needing currentColor. */
.logo-tile {
  fill: var(--accent);
}

.logo-x-rise,
.logo-x-fall {
  stroke: #fff;
}

.logo-x-fall {
  opacity: 0.45;
}

.logo-word {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.012em;
  line-height: 1;
  white-space: nowrap;
}

.logo-word span {
  font-weight: 600;
  margin-left: 0.28em;
  opacity: 0.62;
}

/* Header ----------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1501;
  padding: 14px var(--gutter);
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .shell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
}

.site-nav {
  display: flex;
  margin-left: auto;
  gap: 28px;
  padding-inline: 24px;
}

.site-nav a {
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 0;
  transition: color 150ms ease;
}

.site-nav a:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle svg {
  margin-inline: auto;
}

/* Hero ------------------------------------------------------------------- */
.hero {
  padding: calc(var(--header-h) + 80px) var(--gutter) 140px;
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 62%, var(--bg) 100%);
  border-bottom-left-radius: 44px;
  border-bottom-right-radius: 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 56px;
}

.hero-title {
  font-weight: 900;
  font-size: 62px;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hero-title .accent {
  display: block;
  background: linear-gradient(96deg, var(--accent), var(--accent-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.hero-sub {
  margin-top: 22px;
  max-width: 40ch;
  font-size: 20px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.hero-art {
  position: relative;
}

/* Soft accent bloom behind the illustration. */
.hero-art::before {
  content: "";
  position: absolute;
  inset: 4% 2% 12%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 52% 46%,
    rgba(var(--accent-rgb), 0.18),
    rgba(var(--accent-rgb), 0) 68%
  );
}

.hero-art img {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

/* Technology strip — white card lifted over the hero panel ---------------- */
.tech {
  position: relative;
  z-index: 1;
  padding: 0 var(--gutter);
}

.tech-card {
  margin-top: -84px;
  padding: 30px 34px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 48px -24px rgba(var(--ink-rgb), 0.22);
}

.tech-label {
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
}

.tech-list li {
  flex: 1 1 92px;
  max-width: 92px;
}

.tech-list img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  /* Partner marks sit back in a single muted tone, lifting to their real
     brand colours on hover. */
  filter: grayscale(1) contrast(0.9);
  opacity: 0.5;
  transition: filter 200ms ease, opacity 200ms ease;
}

.tech-list li:hover img {
  filter: none;
  opacity: 1;
}

/* Projects — staggered two-column grid ----------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 28px;
}

.project:nth-child(2n) {
  margin-top: 56px;
}

.project img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background-color: var(--surface);
  box-shadow: 0 1px 2px 0 rgba(var(--ink-rgb), 0.04),
    0 8px 24px -8px rgba(var(--ink-rgb), 0.12);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.project img:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 1px 2px 0 rgba(var(--ink-rgb), 0.04),
    0 18px 40px -12px rgba(var(--ink-rgb), 0.2);
}

/* Services — divided two-column list ------------------------------------- */
.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 60px;
}

.service-item {
  display: flex;
  gap: 18px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.icon-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 12px;
  background-color: var(--accent-soft);
  color: var(--accent);
}

.icon-tile svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.service-body h3 {
  font-weight: 700;
  font-size: 21px;
  line-height: 1.25;
  color: var(--ink);
}

.service-body p {
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
}

/* How we works — pills + vertical timeline -------------------------------- */
.process-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 56px;
}

.process-points li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--surface);
  font-size: 16px;
  color: var(--ink);
}

.process-points svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: var(--accent-x);
}

.timeline {
  max-width: 860px;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 0 26px;
  padding-bottom: 40px;
}

/* Connector between the step markers. */
.timeline li::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 52px;
  bottom: 0;
  width: 2px;
  background-color: var(--line);
}

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

.timeline li:last-child::before {
  display: none;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  font-size: 19px;
  line-height: 1;
  /* Ring keeps the connector from touching the marker. */
  box-shadow: 0 0 0 6px var(--surface);
}

.timeline h3 {
  padding-top: 10px;
  font-weight: 900;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}

.timeline p {
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

/* Contact — copy beside the form ----------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 60px;
}

.contact-grid .section-head {
  margin-bottom: 0;
}

.contact-form {
  display: grid;
  gap: 18px;
  width: 100%;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  caret-color: var(--accent);
}

.contact-form textarea {
  height: 150px;
  resize: none;
}

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

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.form-actions {
  display: flex;
}

.form-actions .btn {
  padding-inline: 34px;
}

.form-note {
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}

/* Footer ----------------------------------------------------------------- */
.site-footer {
  padding: 34px var(--gutter);
  background-color: var(--ink);
  color: var(--ink-contrast);
}

.footer-top {
  display: flex;
  align-items: center;
  gap: 14px 24px;
  min-height: 50px;
}

.footer-links {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 26px;
  padding-inline: 24px;
}

.footer-links a {
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.75;
  transition: opacity 150ms ease;
}

.footer-links a:hover {
  opacity: 1;
}

.footer-note {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
  opacity: 0.55;
}

/* Legal pages ------------------------------------------------------------ */
.legal {
  padding: calc(var(--header-h) + 64px) var(--gutter) 88px;
}

.legal .shell {
  max-width: 820px;
}

.legal-title {
  font-weight: 900;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.legal-title .dot {
  color: var(--accent);
}

.legal-meta {
  margin-top: 10px;
  font-size: 16px;
  color: var(--muted);
}

.legal h2 {
  margin-top: 44px;
  font-weight: 700;
  font-size: 23px;
  line-height: 1.3;
}

.legal p {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
}

.legal ul {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  row-gap: 12px;
}

.legal ul li {
  position: relative;
  padding-left: 26px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
}

.legal ul li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
}

.legal strong {
  color: var(--ink);
  font-weight: 700;
}

.legal a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.legal a:hover {
  text-decoration: underline;
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .hero-title {
    font-size: 52px;
  }

  .hero {
    padding-bottom: 120px;
  }

  .service-list {
    gap: 0 40px;
  }
}

@media (max-width: 900px) {
  .site-nav {
    position: absolute;
    inset: 100% 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 8px var(--gutter) 16px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 16px 0 rgba(var(--ink-rgb), 0.08);
  }

  .site-nav:not(.is-open) {
    display: none;
  }

  .site-nav a {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
  }

  .nav-toggle {
    display: block;
  }

  .site-header .shell .btn {
    display: none;
  }

  .section {
    padding-block: 72px;
  }

  .hero {
    padding-top: calc(var(--header-h) + 48px);
    padding-bottom: 110px;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .hero-art {
    max-width: 440px;
    margin-inline: auto;
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project:nth-child(2n) {
    margin-top: 0;
  }

  .service-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .footer-links {
    padding-inline: 0;
    gap: 18px;
  }
}

@media (max-width: 700px) {
  .hero-title {
    font-size: 40px;
  }

  .hero-sub {
    font-size: 18px;
  }

  .section-title,
  .legal-title {
    font-size: 32px;
  }

  .tech-card {
    margin-top: -70px;
    padding: 24px 20px;
  }

  .tech-list {
    justify-content: center;
    gap: 18px;
  }

  .tech-list li {
    flex-basis: 76px;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .footer-top {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }

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

  .timeline li {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0 18px;
  }

  .timeline li::before {
    left: 19px;
    top: 46px;
  }

  .step-num {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 34px;
  }

  .section-title,
  .legal-title {
    font-size: 28px;
  }

  .logo-word {
    font-size: 16px;
  }
}

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

  .btn,
  .project img,
  .tech-list img {
    transition: none;
  }

  .btn:hover,
  .project img:hover {
    transform: none;
  }
}
