/* Pincoya Bioprocess site styles.
   White pages, one sans-serif, deep-sea navy with one teal accent.
   Dark theme: follows the OS by default; the header switch (a CSS-only
   checkbox, because the CSP allows no scripts) flips it for the visit. */

:root {
  --bg: #ffffff;
  --band: #f2f5f7;
  --surface: #ffffff;
  --ink: #14324a;
  --text: #1d2b36;
  --muted: #4f5f6b;
  --line: #d8e0e6;
  --teal: #0b6e78;
  --brand: #14324a;
  --brand-hover: #0b6e78;
  --on-brand: #ffffff;
  --footer-bg: #14324a;
  --footer-text: #c9d6df;
  --footer-strong: #ffffff;
  color-scheme: light;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --wide: 70rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}
:root:has(#theme:checked) {
  --bg: #0d1820;
  --band: #132330;
  --surface: #102029;
  --ink: #e4edf2;
  --text: #d0dbe2;
  --muted: #a3b3bf;
  --line: #263a49;
  --teal: #63c5cd;
  --brand: #2b6788;
  --brand-hover: #1d7680;
  --on-brand: #ffffff;
  --footer-bg: #08121a;
  --footer-text: #9fb2c0;
  --footer-strong: #e4edf2;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not(:has(#theme:checked)) {
    --bg: #0d1820;
    --band: #132330;
    --surface: #102029;
    --ink: #e4edf2;
    --text: #d0dbe2;
    --muted: #a3b3bf;
    --line: #263a49;
    --teal: #63c5cd;
    --brand: #2b6788;
    --brand-hover: #1d7680;
    --on-brand: #ffffff;
    --footer-bg: #08121a;
    --footer-text: #9fb2c0;
    --footer-strong: #e4edf2;
    color-scheme: dark;
  }
  :root:has(#theme:checked) {
    --bg: #ffffff;
    --band: #f2f5f7;
    --surface: #ffffff;
    --ink: #14324a;
    --text: #1d2b36;
    --muted: #4f5f6b;
    --line: #d8e0e6;
    --teal: #0b6e78;
    --brand: #14324a;
    --brand-hover: #0b6e78;
    --on-brand: #ffffff;
    --footer-bg: #14324a;
    --footer-text: #c9d6df;
    --footer-strong: #ffffff;
    color-scheme: light;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
a:focus-visible, .button:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
::selection { background: var(--brand); color: var(--on-brand); }

.skip { position: absolute; left: -999px; top: 0; z-index: 1; background: var(--brand); color: var(--on-brand); padding: 0.5rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }
.skip:hover { color: var(--on-brand); }

.container { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { text-wrap: balance; }
p, dd { text-wrap: pretty; }

/* ─── Header ─── */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 4.5rem; gap: 0 1rem; }
.wordmark { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.125rem; letter-spacing: 0.01em; }
.wordmark span { font-weight: 400; color: var(--muted); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 1.75rem; font-size: 0.9375rem; order: 1; margin-left: auto; }
.site-nav a { color: var(--text); text-decoration: none; padding-block: 0.75rem; }
.site-nav a:hover { color: var(--teal); }
.site-nav .lang { color: var(--muted); border-left: 1px solid var(--line); padding-left: 1.75rem; }

/* Theme switch: a real checkbox (keyboard and screen-reader operable), drawn as a text button. */
.theme-toggle { order: 2; margin-left: 0.75rem; display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer; color: var(--muted); font-size: 0.875rem; padding-block: 0.75rem; position: relative; }
.theme-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.theme-toggle:hover { color: var(--teal); }
.theme-toggle:has(input:focus-visible) { outline: 2px solid var(--teal); outline-offset: 3px; }
.theme-toggle .icon { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 50%; border: 1.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.theme-toggle .to-light { display: none; }
:root:has(#theme:checked) .theme-toggle .to-dark { display: none; }
:root:has(#theme:checked) .theme-toggle .to-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not(:has(#theme:checked)) .theme-toggle .to-dark { display: none; }
  :root:not(:has(#theme:checked)) .theme-toggle .to-light { display: inline; }
  :root:has(#theme:checked) .theme-toggle .to-dark { display: inline; }
  :root:has(#theme:checked) .theme-toggle .to-light { display: none; }
}

/* ─── Hero ─── */
.hero { padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem); }
.hero h1 {
  color: var(--ink); font-weight: 600; letter-spacing: -0.015em;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.12; margin: 0; max-width: 20ch;
}
.hero .lede { font-size: 1.1875rem; color: var(--muted); max-width: 38rem; margin: 1.5rem 0 2.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: center; }
.button {
  display: inline-block; background: var(--brand); color: var(--on-brand); text-decoration: none;
  font-weight: 500; padding: 0.8rem 1.4rem; border-radius: 2px;
}
.button:hover { background: var(--brand-hover); color: var(--on-brand); }
.text-link { font-weight: 500; display: inline-flex; align-items: center; min-height: 2.75rem; }

/* Hero figure: an illustrative mass balance. Teal is material kept (the trunk and the
   co-product), muted is material lost; the trunk narrows at every step. No figures on it. */
.hero-figure { margin: 3rem 0 0; max-width: 30rem; }
.hero-figure svg { display: block; width: 100%; height: auto; }
.hero-figure figcaption { margin-top: 0.75rem; font-size: 0.875rem; color: var(--muted); }
.flow-keep, .flow-co, .flow-loss { fill: none; stroke-linecap: butt; }
.flow-keep { stroke: var(--teal); }
.flow-co { stroke: var(--teal); }
.flow-loss { stroke: var(--muted); opacity: 0.7; }
.flow-step { font-family: var(--sans); font-size: 15px; fill: var(--text); text-anchor: end; }
.flow-step-out { font-weight: 600; fill: var(--ink); }
.flow-tag { font-family: var(--sans); font-size: 13px; fill: var(--muted); }
.flow-tag-co { fill: var(--teal); }
@media (min-width: 1024px) {
  .hero .container { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); gap: 4rem; align-items: center; }
  .hero-figure { margin: 0; }
}

/* ─── Sections ─── */
.section { padding: clamp(3rem, 7vw, 5rem) 0; border-top: 1px solid var(--line); }
.section.band { background: var(--band); border-top: 0; }
.section h2 { color: var(--ink); font-weight: 600; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.2; margin: 0 0 0.75rem; }
.section .intro { color: var(--muted); max-width: 40rem; margin: 0 0 2.5rem; }

/* Services: four named offers, each head left and detail right (two diagnostics, then two studies). */
.offers { display: grid; gap: 3rem; }
.offer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 1.5rem 3rem; border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.offer h3 { color: var(--ink); font-weight: 600; font-size: 1.375rem; line-height: 1.25; margin: 0 0 0.75rem; }
.offer .question { color: var(--teal); font-weight: 500; margin: 0 0 0.75rem; }
.offer .who { color: var(--muted); margin: 0; }
.covers { margin: 0 0 1.5rem; padding-left: 1.1rem; color: var(--muted); }
.covers li { margin-bottom: 0.45rem; }
.covers strong { color: var(--ink); font-weight: 600; }
.terms { margin: 0; display: grid; gap: 0.6rem; border-left: 1px solid var(--teal); padding-left: 1.25rem; }
.terms dt { font-weight: 600; color: var(--ink); }
.terms dd { margin: 0; color: var(--muted); }

/* How we work: three facts. */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin: 0; }
.facts div { border-left: 1px solid var(--teal); padding-left: 1.25rem; }
.facts dt { font-weight: 600; color: var(--ink); margin-bottom: 0.35rem; }
.facts dd { margin: 0; color: var(--muted); }

/* Market band ("Where the value is" / "Por qué Chile"): short argued text with its sources. */
.why p { max-width: 44rem; margin: 0 0 1rem; }
.why .sources { font-size: 0.875rem; color: var(--muted); line-height: 2; margin: 1.5rem 0 0; }
.why .sources a { display: inline-block; padding-block: 0.6rem; line-height: 1.5; }

/* About */
#about p, #acerca p { margin: 0 0 1rem; max-width: 40rem; }
.founder { max-width: 40rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 2px solid var(--ink); }
.founder h3 { color: var(--ink); font-weight: 600; font-size: 1.1875rem; margin: 0 0 0.5rem; }
.founder h3 span { font-weight: 400; color: var(--muted); margin-left: 0.35rem; }
.founder ul { margin: 0 0 1.25rem; padding-left: 1.1rem; color: var(--muted); }
.founder li { margin-bottom: 0.4rem; }
.founder .links { font-size: 0.9375rem; color: var(--muted); line-height: 2.75rem; }
.founder .links a { white-space: nowrap; }

/* Contact */
.contact-box {
  max-width: 44rem;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--teal);
  padding: clamp(1.5rem, 4vw, 2.5rem); margin-top: 1.5rem;
}
.contact-box p { margin: 0 0 1.5rem; max-width: 36rem; }
.contact-box .contact-address { margin: 1rem 0 0; color: var(--muted); font-size: 0.9375rem; user-select: all; overflow-wrap: anywhere; }

/* ─── Footer ─── */
.site-footer { background: var(--footer-bg); color: var(--footer-text); font-size: 0.875rem; }
.site-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; padding-top: 1.75rem; padding-bottom: 1.75rem; }
.site-footer strong { color: var(--footer-strong); font-weight: 500; }

/* ─── Narrow screens ─── */
@media (max-width: 1023px) {
  .theme-toggle .to-dark, .theme-toggle .to-light { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .theme-toggle { padding: 0.75rem 0 0.75rem 0.75rem; }
  .theme-toggle .icon { width: 1.15rem; height: 1.15rem; }
}
@media (max-width: 760px) {
  .site-nav { gap: 0 1rem; font-size: 0.875rem; }
  .site-nav .lang { border-left: 0; padding-left: 0; }
  /* Phones: logo and theme switch share the top row; the menu gets its own row. */
  .site-nav { order: 2; flex-basis: 100%; margin-left: 0; }
  .theme-toggle { order: 1; margin-left: auto; }
  .site-nav .hide-sm { display: none; }
  .offer, .facts { grid-template-columns: 1fr; }
  /* At phone width the figure's labels would shrink below a readable size. */
  .hero-figure { display: none; }
}
