/* =========================================================
   Biotec Environmental Solutions — Stylesheet
   Tokens, reset, layout, components, responsive
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Color */
  --primary: #1B5E4C;
  --primary-dark: #144236;
  --accent: #5FA854;
  --ink: #1A1F1D;
  --paper: #FAFBF8;
  --subtle: #ECEFE8;
  --hairline: #C8CFC5;
  --muted: #6B7569;
  --warning: #B25E2E;

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Spacing scale (8pt) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 16px;
  --s-4: 24px;
  --s-5: 40px;
  --s-6: 64px;
  --s-7: 96px;
  --s-8: 144px;

  /* Layout */
  --maxw: 1240px;
  --maxw-narrow: 880px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius-sm: 2px;
  --radius-md: 4px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* Selection */
::selection { background: var(--accent); color: var(--paper); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Language toggle (body class drives visibility) ---------- */
body[data-lang="en"] [lang="es"] { display: none !important; }
body[data-lang="es"] [lang="en"] { display: none !important; }

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.container--narrow { max-width: var(--maxw-narrow); }

.section {
  padding-top: clamp(64px, 10vw, 120px);
  padding-bottom: clamp(64px, 10vw, 120px);
}
.section--tight { padding-top: clamp(48px, 7vw, 80px); padding-bottom: clamp(48px, 7vw, 80px); }
.section--subtle { background: var(--subtle); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink .eyebrow { color: var(--accent); }
.section--ink .rule { border-color: rgba(255,255,255,0.18); }

.rule {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
}

.display-1 {
  font-family: var(--font-display);
  font-weight: 450;
  font-variation-settings: 'opsz' 144, 'SOFT' 0, 'WONK' 0;
  font-size: clamp(40px, 6.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.display-2 {
  font-family: var(--font-display);
  font-weight: 450;
  font-variation-settings: 'opsz' 144, 'SOFT' 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.022em;
}
.h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'opsz' 96, 'SOFT' 0;
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.018em;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'opsz' 48, 'SOFT' 0;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.012em;
}
.h4 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.lead {
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 60ch;
}
.body-text {
  font-size: 17px;
  line-height: 1.65;
  max-width: 70ch;
}
.body-text + .body-text { margin-top: var(--s-3); }

.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }

/* Display headline accent — italics for emphasis */
.display-1 em, .display-2 em, .h2 em {
  font-style: italic;
  font-variation-settings: 'opsz' 144, 'SOFT' 0;
  color: var(--primary);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 251, 248, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: var(--s-4);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
  color: var(--ink);
}
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.022em;
  font-variation-settings: 'opsz' 48, 'SOFT' 0;
}
.brand__suffix {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.nav__list {
  display: flex;
  gap: var(--s-4);
}
.nav__link {
  font-size: 14.5px;
  text-decoration: none;
  color: var(--ink);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.nav__link:hover { color: var(--primary); }
.nav__link[aria-current="page"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper);
}
.lang-toggle__btn {
  padding: 7px 11px;
  background: transparent;
  border: 0;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.lang-toggle__btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.lang-toggle__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(64px, 9vw, 120px);
  padding-bottom: clamp(48px, 7vw, 80px);
  position: relative;
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
.hero__lead {
  max-width: 28ch;
  margin-top: var(--s-3);
}
.hero__copy {
  margin-top: var(--s-4);
  max-width: 56ch;
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.55;
}
.hero__cta {
  margin-top: var(--s-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
}
.btn__arrow { font-size: 16px; transition: transform 0.2s ease; }
.btn:hover .btn__arrow { transform: translateX(3px); }
.btn--primary {
  background: var(--ink);
  color: var(--paper);
}
.btn--primary:hover { background: var(--primary); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}
.btn--ghost:hover { border-color: var(--ink); }
.btn--accent {
  background: var(--accent);
  color: var(--ink);
}
.btn--accent:hover { background: var(--primary); color: var(--paper); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Process strip (signature element) ---------- */
.process-strip {
  margin-top: var(--s-6);
  padding: var(--s-4) 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.process-strip__svg {
  width: 100%;
  height: auto;
  max-height: 80px;
}
.process-strip__svg .flow-line {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 1;
}
.process-strip__svg .flow-active {
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-dasharray: 6 8;
  animation: flow 4s linear infinite;
}
.process-strip__svg .node {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.25;
}
.process-strip__svg .node-active {
  fill: var(--accent);
  stroke: var(--primary);
  stroke-width: 1.25;
}
.process-strip__svg .node-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  fill: var(--muted);
  text-transform: uppercase;
}
.process-strip__svg .node-num {
  font-family: var(--font-mono);
  font-size: 8px;
  fill: var(--ink);
}

@keyframes flow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -28; }
}

/* ---------- Cards (Why Biotec) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.card {
  padding: var(--s-5) var(--s-4);
  border-left: 1px solid var(--hairline);
  position: relative;
}
.card:first-child { border-left: 0; }
.card__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: var(--s-3);
}
.card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'opsz' 48, 'SOFT' 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin-bottom: var(--s-2);
}
.card__body {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Services snapshot list ---------- */
.snapshot {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s-6);
  align-items: start;
}
.snapshot__head { position: sticky; top: 100px; }
.snapshot__list { border-top: 1px solid var(--hairline); }
.snapshot__item {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: var(--s-3);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--hairline);
  align-items: baseline;
  transition: padding-left 0.2s ease;
}
.snapshot__item:hover { padding-left: 8px; }
.snapshot__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.snapshot__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'opsz' 48, 'SOFT' 0;
  font-size: clamp(20px, 2vw, 24px);
  letter-spacing: -0.012em;
}
.snapshot__arrow { color: var(--muted); font-family: var(--font-mono); }

/* ---------- Service blocks (services page) ---------- */
.service-block {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--s-5);
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--hairline);
}
.service-block:last-child { border-bottom: 0; }
.service-block__num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}
.service-block__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'opsz' 96, 'SOFT' 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.018em;
  margin-bottom: var(--s-3);
}
.service-block__body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  max-width: 64ch;
}
.service-block__body + .service-block__body { margin-top: var(--s-3); }
.tech-list {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px dashed var(--hairline);
}
.tech-list__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--s-2);
}
.tech-list__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tech-list__tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--paper);
}

/* ---------- Principles (about page) ---------- */
.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  border-top: 1px solid var(--hairline);
  padding-top: var(--s-5);
}
.principle__num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--primary);
  margin-bottom: var(--s-3);
}
.principle__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: 'opsz' 48, 'SOFT' 0;
  font-size: 24px;
  letter-spacing: -0.012em;
  margin-bottom: var(--s-2);
  line-height: 1.2;
}
.principle__body {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Industries chips ---------- */
.industries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.industry {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
}
.industry__marker {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(56px, 8vw, 96px) 0;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(95, 168, 84, 0.15), transparent 60%),
    radial-gradient(circle at 20% 90%, rgba(27, 94, 76, 0.25), transparent 50%);
  pointer-events: none;
}
.cta-banner__inner { position: relative; }
.cta-banner__title {
  font-family: var(--font-display);
  font-weight: 450;
  font-variation-settings: 'opsz' 144, 'SOFT' 0;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.022em;
  max-width: 22ch;
  margin-bottom: var(--s-3);
}
.cta-banner__lead {
  font-size: 18px;
  line-height: 1.55;
  color: rgba(250, 251, 248, 0.7);
  max-width: 50ch;
  margin-bottom: var(--s-5);
}
.cta-banner .btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(250, 251, 248, 0.3);
}
.cta-banner .btn--ghost:hover { border-color: var(--paper); }
.cta-banner .btn--accent { background: var(--accent); color: var(--ink); }

/* ---------- Contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-7);
  align-items: start;
}
.contact-info { border-top: 1px solid var(--hairline); }
.contact-info__row {
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--s-3);
  align-items: baseline;
}
.contact-info__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-info__value {
  font-size: 16px;
  line-height: 1.5;
}
.contact-info__value a { color: var(--primary); text-decoration: none; border-bottom: 1px solid var(--hairline); }
.contact-info__value a:hover { border-bottom-color: var(--primary); }

/* ---------- Form ---------- */
.form {
  display: grid;
  gap: var(--s-3);
}
.form__row {
  display: grid;
  gap: var(--s-3);
}
.form__row--2col { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.field__label .req { color: var(--warning); }
.field__input, .field__select, .field__textarea {
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field__input:focus, .field__select:focus, .field__textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 94, 76, 0.12);
}
.field__textarea { min-height: 140px; resize: vertical; font-family: var(--font-body); }
.form__submit {
  justify-self: start;
  margin-top: var(--s-2);
}
.form__success {
  display: none;
  padding: var(--s-3) var(--s-4);
  background: rgba(95, 168, 84, 0.12);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 15px;
}
.form.is-submitted .form__success { display: block; }
.form.is-submitted .form__fields { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--s-5) 0 var(--s-4);
  font-size: 14px;
  color: var(--muted);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--s-4);
  align-items: start;
}
.site-footer__brand .brand { margin-bottom: var(--s-2); }
.site-footer__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}
.site-footer__col h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: var(--s-2);
  font-weight: 500;
}
.site-footer__col a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  padding: 3px 0;
  font-size: 14px;
}
.site-footer__col a:hover { color: var(--primary); }
.site-footer__bottom {
  margin-top: var(--s-5);
  padding-top: var(--s-3);
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2);
  font-size: 12.5px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ---------- Whatsapp floating ---------- */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  width: 54px;
  height: 54px;
  background: #25D366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  transition: transform 0.2s ease;
}
.wa-float:hover { transform: scale(1.05); }
.wa-float svg { width: 28px; height: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card { border-left: 0; border-top: 1px solid var(--hairline); }
  .card:nth-child(odd) { border-right: 1px solid var(--hairline); }
  .card:nth-child(1), .card:nth-child(2) { border-top: 0; }

  .snapshot { grid-template-columns: 1fr; gap: var(--s-4); }
  .snapshot__head { position: static; }

  .service-block { grid-template-columns: 1fr; gap: var(--s-3); }

  .principles { grid-template-columns: 1fr; gap: var(--s-4); }

  .contact-grid { grid-template-columns: 1fr; gap: var(--s-5); }

  .site-footer__inner { grid-template-columns: 1fr; gap: var(--s-4); }
}

@media (max-width: 640px) {
  .nav__list { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.is-open .nav__list {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--hairline);
    padding: var(--s-3) var(--gutter);
    gap: var(--s-3);
  }
  .form__row--2col { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .card { border-right: 0 !important; border-top: 1px solid var(--hairline); }
  .card:first-child { border-top: 0; }
  .contact-info__row { grid-template-columns: 1fr; gap: 4px; }
}
