/* ============================================================
   Odyssey Robotics — hoja única, sin dependencias externas.
   Mismo esquema que la web de Yoctovision (marca hermana):
   cabecera y pie negros, franjas negras, antetítulos con piloto
   y barra bajo los títulos. Acento propio: naranja Odyssey.
   ============================================================ */

:root {
  --ink: #0a0a0a;
  --text: #111111;
  --muted: #474747;
  --faint: #6b6b6b;
  --paper: #ffffff;
  --paper-2: #f5f5f5;
  --line: #e2e2e2;
  --line-strong: #d0d0d0;
  --accent: #d0481d;
  --accent-hi: #f0793f;
  --accent-soft: rgba(208, 72, 29, 0.08);
  --radius: 2px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "Noto Sans", sans-serif;
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; color: var(--text); font-weight: 600; line-height: 1.18; letter-spacing: -0.02em; }
p { margin: 0 0 1rem; }
a { color: inherit; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
ul { margin: 0; padding: 0; list-style: none; }

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

.wrap { width: min(var(--maxw), 92%); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--accent); color: #fff; padding: .6rem 1rem;
}
.skip:focus { left: .5rem; top: .5rem; }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

/* dato pendiente: visible al iterar */
.ph { border-bottom: 1px dashed var(--accent); cursor: help; }

/* ---------- antetítulos y cabeceras de sección ---------- */

.kicker, .eyebrow {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 10px; vertical-align: 1px;
  background: currentColor;
}
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 14px; }
.section-head h2::after {
  content: ""; display: block;
  width: 48px; height: 3px; margin-top: 18px;
  background: var(--accent);
}
.section-lead { color: var(--muted); font-size: 16.5px; margin: 0; }

/* ---------- botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px;
  font: 600 15px/1 var(--sans);
  border: 1px solid transparent; border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .12s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #b83c15; color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); color: var(--text); }
.btn-small { padding: 9px 18px; font-size: 14px; }
button.btn { font-family: var(--sans); }

/* ---------- cabecera (franja negra) ---------- */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  border-bottom: 1px solid #1f1f1f;
}
.site-head .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 84px; flex-wrap: wrap; padding-block: .6rem;
}
.brand { margin-right: auto; }
.brand img { height: 44px; width: auto; filter: invert(1); }

.nav { display: flex; gap: 1.6rem; flex-wrap: wrap; align-items: center; }
.nav a { font-size: 14.5px; color: #c4c4c4; text-decoration: none; white-space: nowrap; }
.nav a:hover { color: #ffffff; }

/* Botón de menú (solo en pantallas estrechas) */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 10px; cursor: pointer;
  background: transparent; border: 1px solid #3a3a3a; border-radius: var(--radius);
}
.nav-toggle span { display: block; height: 2px; background: #ffffff; }
.site-head .btn-ghost { border-color: #3a3a3a; color: #ffffff; }
.site-head .btn-ghost:hover { border-color: #ffffff; color: #ffffff; }
.btn-call { white-space: nowrap; }

/* ---------- portada ---------- */

.hero { padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 5rem); }
.hero-kicker { margin-bottom: 26px; }
.hero-kicker .kicker { margin: 0; }
.hero-grid {
  display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.25rem); font-weight: 700; margin-bottom: 20px; }
.lead { font-size: 17.5px; color: var(--muted); max-width: 52ch; margin-bottom: 26px; }
.lead a { color: var(--text); }
.hero-points { margin-bottom: 30px; }
.hero-points li {
  position: relative; padding-left: 26px; margin-bottom: 10px;
  font-size: 15px; color: var(--muted);
}
.hero-points li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 14px; height: 2px; background: var(--accent);
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.photo { margin: 0; }
.photo img {
  width: 100%; height: auto; border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
}
figcaption.caption {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 12px;
  font: 400 11.5px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint);
}

/* ---------- secciones ---------- */

section { padding: 96px 0; }
.section-alt { background: var(--paper-2); border-block: 1px solid var(--line); }

/* Franjas negras: los colores se redefinen solo dentro de ellas */
.section-dark {
  --text: #ffffff;
  --muted: #b4b4b4;
  --faint: #8a8a8a;
  --line: #262626;
  --accent: #f0793f;
  background: var(--ink);
  color: var(--text);
}
.section-dark .photo img { box-shadow: none; background: #000000; }
/* Foto oscura sobre franja negra: paspartú blanco */
.photo-framed img { padding: 14px; background: #ffffff; }
.section-dark .photo-framed img { background: #ffffff; }
/* Botón y logo de Yoctovision dentro de una franja negra */
.section-dark .btn-ghost { border-color: #3a3a3a; color: #ffffff; }
.section-dark .btn-ghost:hover { border-color: #ffffff; color: #ffffff; }
.section-dark .brand-link img { filter: invert(1); }

/* Bloques numerados (qué hacemos) */
.layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 36px; }
.layer { padding-top: 22px; border-top: 2px solid var(--accent); }
.layer .num {
  display: block; margin-bottom: 14px;
  font: 500 12px/1 var(--mono); letter-spacing: .16em; color: var(--accent);
}
.layer h3 { font-size: 17.5px; margin-bottom: 10px; }
.layer p { color: var(--muted); font-size: 15px; margin: 0; }
.layer a { color: var(--text); }
/* Lo que se entrega con cada componente */
.kit { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.kit li {
  position: relative; padding-left: 20px; margin-bottom: 7px;
  font-size: 14px; color: var(--text);
}
.kit li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 10px; height: 2px; background: var(--accent);
}
/* HMI + armario: misma altura, la HMI más ancha */
.layers-figures { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; margin-top: 56px; }
.layers-figures figure { display: flex; flex-direction: column; }
.layers-figures img { object-fit: cover; }
.layers-figures figure + figure img { flex: 1; height: 0; min-height: 0; }

/* Proyectos */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.project {
  display: flex; flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
}
.project-img { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); }
.project-img img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 24px 24px 26px; }
.project .num {
  display: block; margin-bottom: 10px;
  font: 500 12px/1 var(--mono); letter-spacing: .16em; color: var(--accent);
}
.project h3 { font-size: 16.5px; margin-bottom: 8px; }
.project p { font-size: 14.5px; color: var(--muted); margin: 0; }
.cases-note { margin: 28px 0 0; font-size: 14.5px; color: var(--muted); max-width: 74ch; }

/* Galería de taller (2×2) */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover;
  border-radius: var(--radius); background: #000000;
}
.gallery figcaption { margin-top: 10px; font-size: 13.5px; color: var(--faint); }
.network {
  margin: 40px 0 0; padding: 18px 22px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  font-size: 15.5px; color: var(--muted);
}
.network strong { color: var(--text); }

/* Marca: foto + texto */
.split {
  display: grid; gap: 64px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
}
.split h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 18px; }
.split p { color: var(--muted); max-width: 56ch; }
.split .kicker { color: var(--accent); }
.brand-link { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 28px; margin-top: 28px; }
.brand-link img { height: 44px; width: auto; }

/* Banda de maquinaria (separador) */
.machine-strip {
  height: 32px;
  background: #1a1a1a url("assets/machine-strip.jpg") center / cover no-repeat;
  border-bottom: 2px solid var(--accent);
}

/* ---------- contacto ---------- */

.contact { display: grid; gap: 64px; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }
.contact-copy h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: 16px; }
.contact-copy > p { color: var(--muted); font-size: 16px; margin-bottom: 20px; }
.contact-copy > p:last-of-type { margin-bottom: 28px; }
.contact-copy > .kicker { color: var(--accent); margin-bottom: 14px; }
.contact-list div { display: grid; gap: 3px; padding: 14px 0; border-top: 1px solid var(--line); }
.contact-list dt {
  font: 500 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint);
}
.contact-list dd { margin: 0; font-size: 15px; }
.contact-list a { color: var(--accent); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
form {
  display: grid; gap: 1.1rem;
  padding: 32px; background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.row { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: .35rem; letter-spacing: .02em; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  padding: 12px 14px; background: #fafafa;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 7rem; resize: vertical; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: 13.5px; color: var(--muted); font-weight: 400; }
.check input { width: auto; margin-top: .2rem; }
.hp { position: absolute; left: -9999px; }
input[type="file"] { padding: .55rem .7rem; font-size: 14px; }
input[type="file"]::file-selector-button {
  font: 500 13.5px var(--sans); color: var(--text); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .4rem .75rem;
  margin-right: .75rem; cursor: pointer;
}
.req { color: var(--accent); }
.hint { font-size: 12.5px; color: var(--faint); margin: .4rem 0 0; }


/* Acuse del formulario (lo usan contacto.js y contacto.py) */
.aviso {
  background: var(--paper-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); padding: 1.6rem 1.6rem 1.5rem;
}
.aviso h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.aviso p { font-size: 15px; }
.aviso .btn { margin-top: .75rem; }
.aviso.warn { border-left-color: var(--ink); }
.aviso:focus { outline: none; }
.aviso .muted { font-size: 13.5px; }

/* ---------- pie (franja negra) ---------- */

.site-foot { background: var(--ink); color: #8a8a8a; padding: 56px 0 36px; font-size: 14px; }
.site-foot .top { display: flex; gap: 2rem; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; }
.site-foot img { height: 34px; width: auto; }
.site-foot .tag { margin: 14px 0 0; max-width: 40ch; }
.site-foot a { color: #d6d6d6; text-decoration: none; }
.site-foot a:hover { color: #ffffff; }
.legal-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.entity { margin: 2rem 0 0; padding-top: 1.5rem; border-top: 1px solid #262626; font-size: 13px; line-height: 1.7; }

/* ---------- páginas legales ---------- */

.legal { max-width: 72ch; padding: clamp(3rem, 6vw, 4.5rem) 0 4.5rem; }
.legal h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.1rem; margin: 2.25rem 0 .7rem; }
.legal p, .legal li { font-size: 15px; color: var(--muted); }
.legal .kicker { color: var(--accent); }
.legal ul { list-style: disc; padding-left: 1.2rem; margin-bottom: 1rem; }
.legal a:not(.btn) { color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-bottom: 1rem; }
th, td { text-align: left; padding: .75rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
  font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--faint); border-bottom-color: var(--text);
}
tbody th { font-weight: 600; color: var(--text); width: 30%; }
td { color: var(--muted); }
.back { display: inline-block; margin-bottom: 2rem; font-size: 14px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero-grid, .split, .contact { grid-template-columns: 1fr; }
  .layers, .projects, .layers-figures { grid-template-columns: 1fr; }
  .layers-figures img { flex: none; height: auto; }
  section { padding: 72px 0; }
  tbody th { width: 40%; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; order: 3; width: 100%;
    flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0 12px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-top: 1px solid #1f1f1f; }
}
@media (max-width: 620px) {
  .site-head .wrap { min-height: 0; gap: .6rem 1rem; }
  .brand img { height: 36px; }
  .gallery, .row { grid-template-columns: 1fr; }
  form { padding: 22px; }
  .cta-row .btn { width: 100%; }
  table { display: block; overflow-x: auto; }
}
@media (max-width: 360px) {
  .btn-call { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
