/* ===============================================
   Espacio SoA — static site
   Light minimalism · Swiss grid · single accent
   =============================================== */

:root {
  --bg: #fcfcfb;
  --surface: #ffffff;
  --ink: #15171c;
  --muted: #5c6270;
  --accent: #2545d3;
  --accent-ink: #1d38ab;
  --accent-soft: #eef1fc;
  --line: #e7e8ea;
  --radius: 10px;
  --maxw: 1140px;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

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

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -0.02em; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(252, 252, 251, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 4.25rem;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
.brand-logo { height: 26px; width: auto; display: block; }
.site-footer .brand-logo { height: 19px; position: relative; top: -1.5px; }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav a {
  color: var(--muted); font-size: 0.95rem; font-weight: 500;
}
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--ink); }
.nav a.active::after {
  content: ""; display: block; height: 2px; background: var(--accent);
  margin-top: 2px; border-radius: 2px;
}

.lang-switch {
  display: flex; gap: 0.15rem; align-items: center;
  border: 1px solid var(--line); border-radius: 99px; padding: 0.2rem;
  font-size: 0.8rem; font-weight: 600;
}
.lang-switch a, .lang-switch span {
  padding: 0.15rem 0.6rem; border-radius: 99px; color: var(--muted);
}
.lang-switch .current { background: var(--ink); color: #fff; }
.lang-switch a:hover { text-decoration: none; color: var(--ink); }

.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 7.5rem 0 6.5rem; position: relative; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.kicker {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent-ink);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.75rem);
  font-weight: 700; max-width: 17ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede {
  margin-top: 1.75rem; max-width: 54ch;
  font-size: 1.2rem; color: var(--muted);
}
.hero .lede-2 { margin-top: 1rem; }
.hero .actions { margin-top: 2.75rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-tags { margin-top: 1.5rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.95rem;
  padding: 0.8rem 1.5rem; border-radius: 99px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(21, 23, 28, 0.18); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- Sections ---------- */
.section { padding: 6rem 0; }
.section.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { margin-bottom: 3.5rem; max-width: 60ch; }
.section-head h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); font-weight: 700; }
.section-head p { margin-top: 1rem; color: var(--muted); font-size: 1.1rem; }

/* Pillars — numbered, hairline-top, Swiss style */
.pillars {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.5rem;
}
.pillar { border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.pillar-top { display: flex; align-items: center; justify-content: space-between; }
.pillar .picon { width: 32px; height: 32px; color: var(--accent); }
.pillar .num {
  font-family: var(--font-display); font-size: 0.85rem; font-weight: 700;
  color: var(--accent); letter-spacing: 0.08em;
}
.pillar h3 { font-size: 1.2rem; margin: 0.5rem 0 0.6rem; }
.pillar p { font-size: 0.95rem; color: var(--muted); }

/* Tech tags (estilo Vercel) */
.tag-groups { display: flex; flex-direction: column; gap: 1.1rem; max-width: 56rem; }
.tag-group { display: flex; align-items: baseline; gap: 1.5rem; }
.tag-label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); min-width: 110px; flex-shrink: 0;
}
@media (max-width: 640px) {
  .tag-group { flex-direction: column; gap: 0.45rem; }
  .tag-label { min-width: 0; }
}
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: 56rem; }
.tag {
  font-size: 0.82rem; font-weight: 500; font-family: var(--font-body);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 0.28rem 0.7rem; background: var(--surface); color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.tag:hover { border-color: var(--accent); color: var(--ink); }

/* Service areas */
.areas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.area {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.area:hover { border-color: var(--accent); transform: translateY(-3px); }
.area .icon { font-size: 1.5rem; margin-bottom: 0.75rem; display: block; }
.area h3 { font-size: 1.05rem; }
.area p { font-size: 0.9rem; color: var(--muted); margin-top: 0.4rem; }

/* ---------- Project cards ---------- */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2rem;
  display: flex; flex-direction: column; gap: 0.9rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(21, 23, 28, 0.06);
}
a.card { color: inherit; }
a.card:hover { text-decoration: none; }
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.badge {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.25rem 0.7rem; border-radius: 99px;
}
.badge-program { background: var(--accent-soft); color: var(--accent-ink); }
.badge-status-ongoing { background: #e5f6ec; color: #16794c; }
.badge-status-done { background: #f1f2f4; color: var(--muted); }
.card h3 { font-size: 1.35rem; }
.card .funding { font-size: 0.82rem; color: var(--muted); }
.card p.desc { font-size: 0.95rem; color: var(--muted); flex: 1; }
.card .more { font-size: 0.9rem; font-weight: 600; }
.eu-funding {
  display: flex; align-items: center; gap: 0.7rem;
  border-top: 1px solid var(--line); padding-top: 0.9rem; margin-top: 0.2rem;
}
.eu-funding img { height: 28px; width: auto; border-radius: 2px; flex-shrink: 0; }
.eu-funding span { font-size: 0.75rem; color: var(--muted); line-height: 1.45; }

/* ---------- Project detail pages ---------- */
.prose { max-width: 70ch; }
.prose p { margin-bottom: 1.1rem; }
.prose ul { margin: 0 0 1.1rem 1.2rem; }
.prose ul li { margin-bottom: 0.4rem; }
.project-body { display: grid; grid-template-columns: 200px 1fr; gap: 3.5rem; align-items: start; }
.project-body > * { min-width: 0; }
.project-side { position: sticky; top: 6rem; }
.project-logo { width: 100%; max-width: 180px; height: auto; object-fit: contain; }
@media (max-width: 800px) {
  .project-body { grid-template-columns: 1fr; gap: 1.5rem; }
  .project-side { position: static; }
  .project-logo { max-width: 120px; }
}
.card { position: relative; }
.card-icon {
  position: absolute; top: 1.5rem; right: 1.5rem;
  height: 56px; width: auto; max-width: 118px; object-fit: contain;
  filter: grayscale(1) opacity(0.4);
  transition: filter 0.25s ease;
}
.card:hover .card-icon { filter: none; }
.card .badges { padding-right: 125px; }
.funding-block { margin-top: 2.5rem; max-width: 70ch; }
.logo-row {
  display: flex; flex-wrap: nowrap; gap: 1.75rem; align-items: center;
  max-width: 100%;
}
.logo-row img { height: 68px; width: auto; max-width: 240px; min-width: 0; flex: 0 1 auto; object-fit: contain; }
.funding-legal { font-size: 0.95rem; color: var(--muted); line-height: 1.65; margin-bottom: 1.75rem; }
.funding-legal p { margin-bottom: 0.7rem; }
.funding-legal p:last-child { margin-bottom: 0; }
.back-link { display: inline-block; margin-bottom: 1.25rem; font-size: 0.9rem; font-weight: 600; }
.breadcrumb { margin-bottom: 1.5rem; font-size: 0.85rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb span { color: var(--ink); font-weight: 500; }

/* ---------- Products ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; align-items: stretch; }
.product-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2.5rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
  border-color: var(--accent); transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(21, 23, 28, 0.06);
}
.pc-head { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 0.25rem; }
.product-card .plogo { height: 78px; width: 78px; object-fit: contain; border-radius: 16px; }
.product-card h3 { font-size: 1.6rem; }
.product-card .tagline { color: var(--accent-ink); font-weight: 600; font-size: 0.95rem; }
.product-card p.desc { color: var(--muted); font-size: 0.97rem; }
.product-card ul { margin: 0.25rem 0 1.5rem 1.1rem; color: var(--muted); font-size: 0.92rem; }
.product-card ul li { margin-bottom: 0.35rem; }
.product-card .btn { margin-top: auto; }
@media (max-width: 900px) { .product-grid { grid-template-columns: 1fr; } }

/* Pricing tiers (InMap) */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.tier {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.75rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.tier.featured { border-color: var(--accent); }
.tier h3 { font-size: 1.05rem; }
.tier .price { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }
.tier .price small { font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.tier p { font-size: 0.9rem; color: var(--muted); }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; } }
.product h3 { font-size: 1.75rem; margin-bottom: 0.4rem; }
.product .tagline { color: var(--accent-ink); font-weight: 600; font-size: 0.95rem; margin-bottom: 1rem; }
.product p { color: var(--muted); }
.product ul { margin: 1rem 0 0 1.1rem; color: var(--muted); font-size: 0.95rem; }
.product ul li { margin-bottom: 0.35rem; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--ink); color: #fff; padding: 5rem 0; }
.cta-band h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); max-width: 24ch; }
.cta-band p { color: #b9bdc7; margin-top: 1rem; max-width: 52ch; }
.cta-band .btn-primary { background: #fff; color: var(--ink); margin-top: 2rem; }

/* Repos open source (banda oscura InMap) */
.repo-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem; margin-top: 2rem;
}
.repo-card {
  display: block; padding: 1.25rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: var(--radius);
  color: #fff; transition: border-color 0.2s ease, background 0.2s ease;
}
.repo-card:hover { border-color: #fff; background: rgba(255, 255, 255, 0.06); text-decoration: none; }
.repo-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.repo-card p { color: #b9bdc7; font-size: 0.85rem; line-height: 1.5; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.site-footer .wrap {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--muted);
}
.site-footer .wrap > div { display: flex; align-items: center; gap: 0.9rem; }
.site-footer .brand { display: flex; align-items: center; }
.site-footer .wrap > div p { margin: 0; }
.site-footer .brand { font-size: 0.95rem; }
.site-footer address { font-style: normal; }
.heart { color: #e11d48; }
.footer-sub {
  margin-top: 0.6rem; font-size: 0.8rem; color: var(--muted);
}
.footer-sub a { color: var(--muted); font-weight: 500; }
.footer-sub a:hover { color: var(--ink); }
.x-link { display: inline-flex; align-items: center; gap: 0.32rem; }
.x-link svg { width: 11px; height: 11px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pillars, .areas { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: 1fr; }
  .product { grid-template-columns: 1fr; gap: 1.75rem; }
}
@media (max-width: 640px) {
  .hero { padding: 5rem 0 4.5rem; }
  .section { padding: 4rem 0; }
  .pillars, .areas { grid-template-columns: 1fr; }
  .site-header .wrap {
    gap: 0.4rem 0.75rem; height: auto; min-height: 3.25rem;
    padding-top: 0.6rem; padding-bottom: 0.6rem; flex-wrap: wrap;
  }
  .brand { font-size: 1.05rem; }
  .brand-logo { height: 21px; }
  .nav { gap: 0.5rem 0.8rem; flex-wrap: wrap; justify-content: flex-end; }
  .nav a:not(.lang-switch a) { font-size: 0.85rem; }
  .lang-switch { font-size: 0.72rem; padding: 0.15rem; }
  .lang-switch a, .lang-switch span { padding: 0.12rem 0.45rem; }
  .card .badges { padding-right: 70px; }
  .card-icon { height: 40px; max-width: 80px; }
}
