:root {
  /* surfaces */
  --paper: #FAF7F1;
  --paper-deep: #F4EEE3;
  --card: #FFFFFF;
  /* text */
  --ink: #1C1917;
  --ink-soft: #57534E;
  --ink-faint: #8A8177;
  /* rules */
  --hairline: #E7DFD3;
  --hairline-strong: #D8CDBB;
  /* single accent — terracotta */
  --acc: #B4452A;
  --acc-deep: #93391F;
  --acc-wash: #F3E4DC;
  /* type + shape */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 8px;
  --container: min(1120px, calc(100vw - 40px));
  /* legacy aliases consumed by ai-readiness.css */
  --background: var(--paper);
  --foreground: var(--ink);
  --surface: var(--card);
  --surface-light: var(--paper-deep);
  --border: var(--hairline);
  --border-light: var(--hairline-strong);
  --muted: var(--ink-faint);
  --muted-light: var(--ink-soft);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--paper); color: var(--ink); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
}

body::selection { background: var(--acc-wash); color: var(--ink); }

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

.nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px max(20px, calc((100vw - 1120px) / 2));
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, padding 200ms ease;
}

.nav.scrolled {
  padding-block: 12px;
  border-bottom-color: var(--hairline);
}

.brand { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.brand-dot { color: var(--acc); }

.nav nav { display: flex; gap: 22px; color: var(--ink-soft); font-size: 14px; }
.nav nav a:hover { color: var(--ink); }

/* nav dropdowns (Servicios / Portafolio) — hover on mouse, focus-within on keyboard */
.nav-item { position: relative; }
.nav-item > a { display: inline-flex; align-items: center; gap: 6px; }
.nav-item > a::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.5;
}
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: -14px;
  z-index: 30;
  padding-top: 22px; /* hover bridge to the header's bottom edge */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 0s linear 150ms;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}
.nav-dropdown-inner {
  display: grid;
  gap: 2px;
  min-width: 300px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(28, 25, 23, 0.1);
}
.nav-dropdown-inner a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  color: var(--ink);
}
.nav-dropdown-inner a:hover { background: var(--paper-deep); }
.nav-num {
  color: var(--acc);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.nav-cat {
  margin-left: auto;
  padding-left: 14px;
  color: var(--ink-faint);
  font-size: 12px;
  white-space: nowrap;
}
.nav-dropdown-wide .nav-dropdown-inner {
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
  min-width: 560px;
}

.nav-cta {
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 10px 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  transition: background 200ms ease, color 200ms ease;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }

.lang-toggle {
  appearance: none;
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 6px 10px;
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease;
}
.lang-toggle:hover { border-color: var(--ink); color: var(--ink); }

main, footer { position: relative; z-index: 1; }

.hero {
  position: relative;
  padding: 180px max(20px, calc((100vw - 1120px) / 2)) 96px;
}

.hero-copy { width: min(760px, 100%); }
.eyebrow {
  margin: 0 0 18px;
  color: var(--acc-deep);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 22px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 1.03;
  letter-spacing: -0.015em;
}

h2 {
  max-width: 820px;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.01em;
}
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.18;
  letter-spacing: -0.005em;
}

.hero-line {
  max-width: 620px;
  margin-bottom: 34px;
  color: var(--ink-soft);
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.5;
}

.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 6px;
  padding: 0 22px;
  font-weight: 600;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}
.button.primary { background: var(--ink); color: var(--paper); }
.button.primary:hover { background: var(--acc); }
.button.ghost { border: 1px solid var(--hairline-strong); background: none; color: var(--ink); }
.button.ghost:hover { border-color: var(--ink); }

.section { width: var(--container); margin: 0 auto; padding: 110px 0; }
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr); gap: 56px; align-items: start; }
.copy-stack { color: var(--ink-soft); font-size: clamp(17px, 1.8vw, 20px); line-height: 1.55; }
.copy-stack p { margin-bottom: 20px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 36px; border-top: 1px solid var(--hairline); padding-top: 24px; }
.metrics span { color: var(--ink-faint); font-size: 13px; }
.metrics strong { display: block; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 34px; letter-spacing: 0; }

.section-divider { width: var(--container); height: 1px; margin: 0 auto; background: var(--hairline); }

.service-list { margin-top: 56px; border-top: 1px solid var(--hairline); }
.service-list article {
  position: relative; /* anchors the stretched .service-more link — whole row is clickable */
  display: grid;
  grid-template-columns: 80px 0.8fr 1fr;
  gap: 28px;
  padding: 34px 0;
  border-bottom: 1px solid var(--hairline);
}
.service-list article .service-more::after { content: ""; position: absolute; inset: 0; }
.service-list article:hover h3 { color: var(--acc-deep); }
.service-list article:hover .service-more { color: var(--ink); }
.service-list span, .projects span {
  color: var(--acc-deep);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.service-list p { color: var(--ink-soft); font-size: 17px; line-height: 1.55; }

.section-intro { max-width: 680px; color: var(--ink-soft); font-size: 19px; line-height: 1.5; }
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 46px; align-items: start; }
.projects a {
  display: block;
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.projects a:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-strong);
  box-shadow: 0 6px 20px rgba(28, 25, 23, 0.06);
}
.projects a[hidden] { display: none; }
.projects a:not(.has-shot) { min-height: 220px; }
.projects h3 { margin: 14px 0 8px; }
.projects p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }

.projects a.has-shot .shot {
  margin: -24px -24px 18px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}
.shot { display: block; }
.shot img { display: block; width: 100%; }
.projects .shot img { height: 100%; object-fit: cover; object-position: top; }

.project-page { min-height: 100svh; }
.project-hero {
  width: var(--container);
  margin: 0 auto;
  padding: 150px 0 80px;
}
.project-hero h1 {
  max-width: 980px;
  font-size: clamp(52px, 8vw, 108px);
}
.project-lede {
  max-width: 820px;
  color: var(--ink-soft);
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.3;
}
.project-hero .button { margin-top: 10px; }
.back-link {
  display: inline-flex;
  margin-bottom: 42px;
  color: var(--ink-faint);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.back-link:hover { color: var(--ink); }

.project-shot { width: var(--container); margin: 0 auto; }
.project-shot img { border: 1px solid var(--hairline); border-radius: 10px; }

.project-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 42px;
  padding-top: 40px;
}
.project-detail article {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 42px;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--hairline);
}
.project-detail p:not(.eyebrow) {
  color: var(--ink-soft);
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 1.55;
}
.project-results {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 70px;
  padding-top: 40px;
}
.project-results ul { margin: 0; padding: 0; list-style: none; }
.project-results li {
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.5;
}
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
.tags li {
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 10px 13px;
  background: var(--paper-deep);
  color: var(--ink);
}

.process ol { display: grid; gap: 0; margin: 52px 0 0; padding: 0; list-style: none; counter-reset: step; border-top: 1px solid var(--hairline); }
.process li { counter-increment: step; display: grid; grid-template-columns: 90px 0.6fr 1fr; gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--hairline); }
.process li::before { content: counter(step, decimal-leading-zero); color: var(--acc-deep); font-family: var(--font-sans); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; }
.process strong { font-size: 17px; }
.process span { color: var(--ink-soft); line-height: 1.5; }

.final-cta { display: grid; align-content: center; text-align: center; justify-items: center; }
.final-cta p:not(.eyebrow) { color: var(--ink-soft); font-size: 20px; }
.final-cta .button { margin-top: 10px; }

.cta-band { display: grid; justify-items: center; text-align: center; }
.cta-band h2 { margin-bottom: 16px; }
.cta-band p:not(.eyebrow) { max-width: 600px; color: var(--ink-soft); font-size: clamp(17px, 2vw, 20px); line-height: 1.5; }
.cta-band .button { margin-top: 28px; }

footer { width: var(--container); margin: 0 auto; padding: 38px 0; display: flex; justify-content: space-between; gap: 24px; color: var(--ink-faint); border-top: 1px solid var(--hairline); }
.footer-contact { font-size: 13px; }
.footer-contact a:hover { color: var(--ink); }

.reveal { opacity: 0; transform: translateY(12px); transition: opacity 500ms ease, transform 500ms ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 780px) {
  .nav { padding: 16px 20px; }
  .nav nav { display: none; }
  .nav-cta { display: none; }
  .hero { padding-top: 140px; }
  .split, .service-list article, .process li { grid-template-columns: 1fr; gap: 12px; }
  .metrics, .projects { grid-template-columns: 1fr; }
  .project-detail article, .project-results { grid-template-columns: 1fr; gap: 16px; }
  .section { padding: 82px 0; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ── Industry filter chips, service cross-links, sub-landing sections ── */
.filter-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.chip {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 10px 14px;
  background: none;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { border-color: var(--acc); background: var(--acc-wash); color: var(--acc-deep); }

.service-more {
  display: inline-flex;
  margin-top: 14px;
  color: var(--acc-deep);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.service-more:hover { color: var(--ink); }

.service-note { color: var(--ink-soft); font-size: 16px; line-height: 1.5; margin-bottom: 16px; }
.service-pill {
  display: inline-flex;
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  transition: border-color 200ms ease, transform 200ms ease;
}
.service-pill:hover { border-color: var(--ink); transform: translateY(-2px); }

.footer-links { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; font-size: 13px; }
.footer-links a:hover { color: var(--ink); }

.sl-hero h1 { max-width: 980px; font-size: clamp(34px, 5.5vw, 64px); line-height: 1.12; }
.sl-hero .actions { margin-top: 28px; }

.symptom-list { margin: 42px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--hairline); max-width: 820px; }
.symptom-list li {
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.5;
}

/* ── Split hero + hero SVG ── */
.hero-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px; align-items: center; }
.hero-split .hero-copy { width: 100%; }
.hero-split .hero-copy h1 { font-size: clamp(38px, 4.4vw, 62px); }
.sl-hero.hero-split h1 { font-size: clamp(32px, 3.8vw, 54px); }
.hero-art { width: 100%; max-width: 560px; justify-self: end; }
.sl-hero .hero-art { max-width: 500px; }
.hero-art svg { display: block; width: 100%; height: auto; }
.hero-art.reveal { transition-delay: 100ms; }

@media (max-width: 960px) {
  .hero-split { grid-template-columns: 1fr; gap: 40px; }
  .hero-art { justify-self: start; max-width: 440px; }
}

/* Shared styles for the inline hero SVGs (home + service landings) */
.sd-messy { fill: var(--card); stroke: var(--hairline-strong); stroke-width: 1.1; }
.sd-messy-g { transform-box: fill-box; transform-origin: center; animation: sd-jitter 6s ease-in-out infinite; }
.sd-j2 { animation-delay: -0.9s; }
.sd-j3 { animation-delay: -1.9s; }
.sd-j4 { animation-delay: -2.8s; }
.sd-j5 { animation-delay: -3.7s; }
.sd-j6 { animation-delay: -4.6s; }
.sd-line { fill: none; stroke: var(--ink); stroke-opacity: 0.2; stroke-width: 1.6; stroke-linecap: round; }
.sd-line-sm { fill: none; stroke: var(--ink); stroke-opacity: 0.13; stroke-width: 1.4; stroke-linecap: round; }
.sd-row { fill: var(--card); stroke: var(--hairline); stroke-width: 1.1; }
.sd-rowfill { fill: var(--acc-wash); }
.sd-tab { fill: var(--acc); }
.sd-check { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sd-label {
  font: 700 10px/1 var(--font-sans);
  fill: var(--ink-faint);
  letter-spacing: 0.12em;
}
.sd-label-a { fill: var(--acc-deep); }
.sd-axis { stroke: var(--hairline); stroke-width: 1; }
.sd-fallback { display: none; }

@keyframes sd-jitter {
  0%, 100% { transform: translate(0, 0) rotate(var(--r, 0deg)); }
  25% { transform: translate(1.5px, -2px) rotate(calc(var(--r, 0deg) + 1.2deg)); }
  50% { transform: translate(-1px, 1.5px) rotate(calc(var(--r, 0deg) - 1deg)); }
  75% { transform: translate(2px, 1px) rotate(calc(var(--r, 0deg) + 0.6deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .sd-messy-g { animation: none !important; }
  .sd-anim { display: none !important; }
  .sd-fallback { display: inline !important; }
  .sd-static { opacity: 1 !important; }
  .sd-check { stroke-dashoffset: 0 !important; }
}

/* ── Brochure gate (BI page) ── */
.brochure-form { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.brochure-form input[type="email"] {
  min-height: 48px;
  min-width: min(320px, 100%);
  padding: 0 16px;
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.brochure-form input[type="email"]:focus { outline: none; border-color: var(--acc); }
.brochure-form .button { border: none; cursor: pointer; }
.brochure-success { color: var(--acc-deep); font-weight: 600; }
.cta-band [hidden] { display: none !important; }
