:root {
  --navy: #0b1526;
  --navy-2: #13213a;
  --ink: #0f172a;
  --muted: #5b6474;
  --line: #e4e7ec;
  --paper: #ffffff;
  --paper-alt: #f6f7f9;
  --emerald: #34d399;
  --emerald-dark: #047857;
  --on-dark: #e6ebf2;
  --on-dark-muted: #9aa6b8;
  --max: 1140px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--navy); color: var(--on-dark); padding-bottom: 6rem; }
.hero:not(.hero--compact) {
  background:
    linear-gradient(90deg, var(--navy) 0%, rgba(11, 21, 38, .92) 35%, rgba(11, 21, 38, .45) 70%, rgba(11, 21, 38, .25) 100%),
    linear-gradient(0deg, rgba(11, 21, 38, .6), transparent 30%),
    url("assets/lisbon-hero.jpg") 70% 40% / cover no-repeat,
    var(--navy);
}
.hero__caption { position: absolute; left: 0; right: 0; bottom: 1.25rem; margin: 0 auto; text-align: right; font-size: .75rem; letter-spacing: .08em; color: var(--on-dark-muted); opacity: .8; }
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; padding-top: 1.75rem; padding-bottom: 1.75rem; }
.logo { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03em; text-decoration: none; color: #fff; }
.logo span { color: var(--emerald); }
.nav ul { display: flex; gap: 2rem; align-items: center; }
.nav ul a { text-decoration: none; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-muted); }
.nav ul a:hover { color: #fff; }
.nav .nav__cta { color: var(--emerald); }

.hero__body { position: relative; padding-top: 5rem; }
.eyebrow { color: var(--emerald); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; margin-bottom: 1.5rem; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); max-width: 14ch; color: #fff; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--on-dark-muted); max-width: 46rem; margin-top: 1.75rem; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2rem; margin-top: 2.5rem; }
.btn { display: inline-block; background: var(--emerald); color: var(--navy); font-weight: 600; text-decoration: none; padding: .95rem 1.5rem; border-radius: 4px; transition: background .15s; }
.btn:hover { background: #6ee7b7; }
.link { text-decoration: none; color: var(--on-dark); border-bottom: 1px solid transparent; }
.link:hover { border-color: currentColor; }

/* Facts */
.facts { border-bottom: 1px solid var(--line); }
.facts__grid { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 auto; }
.facts__grid > div { padding: 2.25rem 1.5rem 2.25rem 0; }
.facts__grid > div + div { border-left: 1px solid var(--line); padding-left: 1.5rem; }
.facts dt { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; }
.facts dd { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }

/* Sections */
.section { padding: 7rem 0; }
.section--alt { background: var(--paper-alt); }
.label { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--emerald-dark); font-weight: 600; margin-bottom: 1rem; }
.section h2 { font-size: clamp(1.9rem, 3.5vw, 2.75rem); max-width: 22ch; }
.intro { font-size: 1.2rem; color: #2b3445; max-width: 44rem; margin-top: 1.5rem; }

.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 4rem; }
.service { background: var(--paper); padding: 2.5rem; }
.service .service__stage { display: inline-block; margin: 0 0 1.5rem; padding: .3rem .75rem; border: 1px solid var(--emerald-dark); border-radius: 2px; color: var(--emerald-dark); font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; line-height: 1.4; }
.service__stage--any { border-style: dashed; }
.service h3 { font-size: 1.35rem; margin-bottom: 1rem; }
.service blockquote { margin: 0 0 1rem; font-size: 1.05rem; font-style: italic; color: var(--ink); border-left: 2px solid var(--emerald); padding-left: 1rem; }
.service p { color: var(--muted); margin: 0; }

.domains { margin-top: 5rem; }
.domains__title { font-size: 1.5rem; }
.domains__intro { color: var(--muted); margin: .5rem 0 2rem; }
.domains__table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.domains__table thead th { text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 1.5rem .75rem 0; border-bottom: 2px solid var(--ink); }
.domains__table tbody th, .domains__table td { text-align: left; vertical-align: top; padding: 1.25rem 1.5rem 1.25rem 0; border-bottom: 1px solid var(--line); }
.domains__table tbody th { width: 26%; font-weight: 600; color: var(--ink); }
.domains__table td { color: var(--muted); }
.domains__table td:last-child { width: 18%; padding-right: 0; color: var(--ink); font-size: .9rem; }
.domains__table em { display: block; font-style: normal; font-weight: 600; color: var(--emerald-dark); margin-bottom: .2rem; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; margin-top: 3.5rem; }
.pillars > div { border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.pillars h3 { font-size: 1.2rem; margin-bottom: .75rem; }
.pillars p { color: var(--muted); }

.pillars--four { grid-template-columns: repeat(4, 1fr); gap: 2.5rem; }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem; list-style: none; margin: 4rem 0 0; padding: 0; counter-reset: step; }
.flow li { position: relative; background: var(--navy); color: var(--on-dark-muted); padding: 1.5rem; border-radius: 4px; font-size: .95rem; counter-increment: step; }
.flow li::before { content: "0" counter(step); display: block; color: var(--emerald); font-size: .75rem; font-weight: 600; letter-spacing: .12em; margin-bottom: .75rem; }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -1.75rem; top: 50%; transform: translateY(-50%); color: var(--emerald-dark); font-size: 1.25rem; }
.flow span { display: block; color: #fff; font-size: 1.1rem; font-weight: 600; margin-bottom: .25rem; }
.flow__base { margin: 1rem 0 0; padding: 1rem 1.5rem; border: 1px dashed var(--emerald-dark); border-radius: 4px; color: var(--muted); font-size: .95rem; }
.flow__base span { color: var(--ink); font-weight: 600; margin-right: .75rem; }

.clients { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 2rem 3rem; margin: 3.5rem 0; padding: 2.5rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.clients li { display: flex; }
.clients img { height: var(--h, 28px); width: auto; opacity: .55; }
.logo--backbase { --h: 22px; }
.logo--intellect { --h: 34px; }
.logo--sofi { --h: 38px; }
.logo--zafin { --h: 32px; }
.logo--omnumi { --h: 19px; }

.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.case a { color: var(--emerald-dark); font-weight: 600; }
.case { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 2rem; display: flex; flex-direction: column; }
.case__tag { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--emerald-dark); font-weight: 600; }
.case h3 { font-size: 1.2rem; margin-bottom: 1.25rem; }
.case p { font-size: .95rem; color: #2b3445; }
.case strong { display: block; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin-bottom: .2rem; }
.case__challenge { color: var(--muted) !important; }
.todo { background: #fef9c3; color: #713f12; }

.about { display: grid; grid-template-columns: 5fr 7fr; gap: 5rem; align-items: start; }
.about p { color: #2b3445; }
.about__photo { position: sticky; top: 2rem; }
.about__photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 6px; object-fit: cover; object-position: 50% 30%; }
.credentials { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .95rem; color: #2b3445; }
.credentials li { position: relative; padding-left: 1.25rem; margin-bottom: .6rem; }
.credentials li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--emerald-dark); }
.credentials a { color: var(--emerald-dark); font-weight: 600; text-decoration: none; }
.creds { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .95rem; }
.creds a { color: var(--emerald-dark); font-weight: 600; text-decoration: none; }
.creds a:hover { text-decoration: underline; }

/* Contact */
.contact { background: var(--navy); color: var(--on-dark); padding: 7rem 0; }
.contact h2 { font-size: clamp(2rem, 4vw, 3rem); color: #fff; max-width: 20ch; }
.contact__list { display: flex; flex-wrap: wrap; gap: 1.5rem 4rem; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.1); }
.contact__list span { display: block; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-muted); margin-bottom: .25rem; }
.contact__list a { text-decoration: none; color: #fff; }
.contact__list a:hover { color: var(--emerald); }

.footer { background: var(--navy); color: var(--on-dark-muted); font-size: .85rem; border-top: 1px solid rgba(255,255,255,.08); }
.footer__grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-top: 1.75rem; padding-bottom: 1.75rem; }
.footer p { margin: 0; }
.footer a { text-decoration: none; }
.footer a:hover { color: #fff; }

/* Sub-pages (privacy, 404): keep the footer at the bottom of the window on short pages */
.subpage { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.subpage main { flex: 1; }

/* Privacy page */
.page { padding: 5rem 0 7rem; }
.page .wrap { max-width: 46rem; }
.page h1 { font-size: 2.5rem; margin-bottom: 2rem; }
.page h2 { font-size: 1.25rem; margin: 2.5rem 0 .75rem; }
.page p, .page li { color: #2b3445; }
.page ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 1rem; }
.hero--compact { padding-bottom: 0; }

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

@media (max-width: 900px) {
  .services, .cases, .pillars, .about { grid-template-columns: 1fr; }
  .pillars--four { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .flow li::after { display: none; }
  .about { gap: 2.5rem; }
  /* Single column: the photo sits above the text, so it must scroll away with it. */
  .about__photo { position: static; max-width: 180px; }
  .about__photo img { aspect-ratio: 1 / 1; object-position: 50% 25%; }
  .facts__grid { grid-template-columns: repeat(2, 1fr); }
  .facts__grid > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .facts__grid > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .section, .contact { padding: 5rem 0; }
}

@media (max-width: 640px) {
  .nav ul li:not(:last-child) { display: none; }
  .hero__body { padding-top: 2.5rem; }
  .hero { padding-bottom: 4rem; }
  .hero:not(.hero--compact) {
    background:
      linear-gradient(0deg, var(--navy) 0%, rgba(11, 21, 38, .88) 55%, rgba(11, 21, 38, .55) 100%),
      url("assets/lisbon-hero.jpg") 70% 40% / cover no-repeat,
      var(--navy);
  }
  .service, .case { padding: 1.75rem; }
  .pillars--four, .flow { grid-template-columns: 1fr; }
  .domains__table thead { display: none; }
  .domains__table tr { display: block; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
  .domains__table tbody th, .domains__table td, .domains__table td:last-child { display: block; width: auto; padding: 0; border: 0; }
  .domains__table td { margin-top: .4rem; }
  .domains__table td:last-child { font-size: .8rem; color: var(--muted); }
  .domains__table td:last-child::before { content: "Proven at "; }
  .flow__base span { display: block; margin: 0 0 .25rem; }
  .facts dt { font-size: 1.6rem; }
}

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