:root {
  --bone: #f6f1e7;
  --bone-dim: #ece3d2;
  --ink: #26211a;
  --ink-soft: #5b5347;
  --terracotta: #b3572f;
  --terracotta-dark: #8f4322;
  --sand: #d8c9ac;
  --line: #ddd2ba;
  --good: #3f7d54;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(38, 33, 26, 0.08);
  --max-width: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bone: #1c1812;
    --bone-dim: #221d16;
    --ink: #f1ead9;
    --ink-soft: #c3b8a2;
    --terracotta: #e07a48;
    --terracotta-dark: #f19566;
    --sand: #4a4030;
    --line: #3a3225;
    --good: #6fbf85;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, "Segoe UI", sans-serif;
  line-height: 1.55;
}

h1, h2, h3 { font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.15; margin: 0; }

code {
  background: var(--sand);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

a { color: inherit; }

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--terracotta-dark); }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bone) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.1rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.4rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}
.brand-icon { font-size: 1.7rem; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--terracotta); }
.nav-cta {
  background: var(--terracotta);
  color: #fff !important;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
}
.nav-cta:hover { background: var(--terracotta-dark); color: #fff !important; }
.nav-cta.is-current { background: var(--terracotta-dark); }

.nav-pycon {
  border: 1px solid var(--terracotta);
  color: var(--terracotta) !important;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
}
.nav-pycon:hover { background: var(--terracotta); color: #fff !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
}

/* ---------- hero ---------- */
.hero {
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.eyebrow, .section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--terracotta);
  margin: 0 0 0.75rem;
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); margin-bottom: 1.1rem; }
.hero-subtitle { font-size: 1.15rem; color: var(--ink-soft); margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 3rem; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.hero-stat { display: flex; flex-direction: column; }
.hero-stat-value { font-size: 1.8rem; font-weight: 800; color: var(--terracotta); }
.hero-stat-label { font-size: 0.85rem; color: var(--ink-soft); }
.hero-footnote { font-size: 0.78rem; color: var(--ink-soft); max-width: 640px; margin: 1.5rem auto 0; line-height: 1.5; }
.hero-footnote a { color: var(--terracotta); }

/* ---------- sections ---------- */
.section { padding: 5rem 1.5rem; }
.section-alt { background: var(--bone-dim); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 1rem; }
.section-lead { color: var(--ink-soft); max-width: 720px; font-size: 1.05rem; margin-bottom: 2.5rem; }
.subhead { font-size: 1.3rem; margin: 3rem 0 0.75rem; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1.25rem;
  padding-bottom: 2.25rem;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: -0.25rem;
  width: 2px;
  background: var(--line);
}
.timeline-marker {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--terracotta);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.timeline-content h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.timeline-content p { margin: 0; color: var(--ink-soft); }
.timeline-content p + .inline-list { margin-top: 0.75rem; }
.inline-list { margin: 0; padding-left: 1.25rem; color: var(--ink-soft); }
.inline-list li { margin-bottom: 0.35rem; }

/* ---------- flowchart ---------- */
.flowchart { display: flex; flex-direction: column; align-items: center; margin: 2rem 0; }

.flow-node {
  background: var(--bone-dim);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1.15rem;
  max-width: 360px;
  text-align: center;
}
.flow-node.flow-start, .flow-node.flow-end {
  border-color: var(--terracotta);
  background: var(--terracotta);
  color: #fff;
}
.flow-node.flow-start p, .flow-node.flow-end p { color: rgba(255, 255, 255, 0.85); }
.flow-node.flow-aux { border-style: dashed; }
.flow-node .flow-step {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--terracotta-dark);
  margin-bottom: 0.3rem;
}
.flow-node.flow-start .flow-step, .flow-node.flow-end .flow-step { color: rgba(255, 255, 255, 0.75); }
.flow-node h4 { margin: 0 0 0.35rem; font-size: 0.98rem; }
.flow-node p { margin: 0; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.4; }
.flow-node code { font-size: 0.8em; }

.flow-arrow-down {
  width: 2px;
  height: 30px;
  background: var(--line);
  position: relative;
  flex-shrink: 0;
}
.flow-arrow-down::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--line);
}
.flow-arrow-label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0.15rem 0;
}

.flow-branch {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.flow-branch-row {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1.75rem;
  flex-wrap: wrap;
  width: 100%;
  position: relative;
  padding-top: 26px;
}
.flow-branch-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--line);
}
.flow-branch-item { display: flex; flex-direction: column; align-items: center; }
.flow-branch-item::before {
  content: "";
  width: 2px;
  height: 26px;
  background: var(--line);
  margin-top: -26px;
}
.flow-branch-item .flow-node { margin-top: 0; }

@media (max-width: 700px) {
  .flow-branch-row { flex-direction: column; gap: 0.5rem; padding-top: 0; }
  .flow-branch-row::before { display: none; }
  .flow-branch-item::before { display: none; margin-top: 0; }
  .flow-branch-item:not(:first-child) { margin-top: 0.5rem; }
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.results-table { width: 100%; border-collapse: collapse; background: var(--bone); min-width: 560px; }
.results-table th, .results-table td {
  padding: 0.85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.results-table thead th {
  background: var(--sand);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.results-table tbody tr:last-child td { border-bottom: none; }
.row-best { background: color-mix(in srgb, var(--terracotta) 8%, transparent); }
.cell-highlight { font-weight: 700; }
.cell-best { color: var(--good); font-weight: 700; }
.badge {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--terracotta);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.table-note { margin-top: 1rem; font-size: 0.88rem; color: var(--ink-soft); max-width: 720px; }
.results-table-compact th, .results-table-compact td { font-size: 0.88rem; padding: 0.6rem 1rem; }

/* ---------- datos ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--terracotta); }
.stat-label { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.4; }

.pipeline-example {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.pipeline-step {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.pipeline-embed-wrap { position: relative; width: 100%; padding-top: 100%; border-radius: 8px; overflow: hidden; background: #fff; }
.pipeline-embed { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pipeline-img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 8px; background: #fff; cursor: zoom-in; }
.pipeline-img:hover { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.pipeline-caption { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.4; margin: 0; }
.pipeline-caption strong { color: var(--ink); }
.pipeline-caption a { color: var(--terracotta); font-weight: 600; text-decoration: none; }
.pipeline-caption a:hover { text-decoration: underline; }

.imbalance-chart {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.imbalance-row { display: flex; align-items: center; gap: 0.9rem; font-size: 0.92rem; }
.imbalance-label { width: 150px; flex-shrink: 0; }
.imbalance-track { flex: 1; height: 14px; background: var(--sand); border-radius: 999px; overflow: hidden; }
.imbalance-fill { display: block; height: 100%; background: var(--terracotta); border-radius: 999px; }
.imbalance-fill-low { background: #b3402f; }
.imbalance-value { width: 46px; text-align: right; flex-shrink: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.row-warn { background: color-mix(in srgb, #b3402f 6%, transparent); }
.cell-warn { color: #b3402f; font-weight: 700; }

/* ---------- catálogo 3D ---------- */
.catalog-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.catalog-filter-btn {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bone);
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: capitalize;
  cursor: pointer;
}
.catalog-filter-btn.is-active { border-color: var(--terracotta); color: var(--terracotta); font-weight: 700; }
.catalog-table img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 6px; cursor: zoom-in; display: block; }
.catalog-table td { font-size: 0.85rem; vertical-align: middle; }
.catalog-table .no-thumb { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--sand); border-radius: 6px; font-size: 0.7rem; color: var(--ink-soft); }
.catalog-table a { color: var(--terracotta); font-weight: 600; text-decoration: none; }
.catalog-table a:hover { text-decoration: underline; }

/* ---------- nosotros ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.team-card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  text-align: center;
}
.team-avatar { font-size: 2.5rem; margin-bottom: 0.75rem; }
.team-card h3 { font-size: 1.05rem; margin-bottom: 0.25rem; }
.team-role { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }

/* ---------- demo ---------- */
.demo-panel { max-width: 640px; }
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bone);
  transition: border-color 0.15s ease, background 0.15s ease;
  overflow: hidden;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragover {
  border-color: var(--terracotta);
  background: color-mix(in srgb, var(--terracotta) 6%, var(--bone));
}
.dropzone-empty { text-align: center; color: var(--ink-soft); padding: 1.5rem; }
.dropzone-icon { font-size: 2.2rem; display: block; margin-bottom: 0.5rem; }
.dropzone-hint { font-size: 0.85rem; margin-top: 0.25rem; }
.preview-image { max-width: 100%; max-height: 360px; display: block; margin: 0 auto; }

.demo-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

.demo-status {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  background: var(--sand);
  font-size: 0.95rem;
}
.demo-status.is-error { background: color-mix(in srgb, #b3402f 20%, var(--bone)); }

.leak-banner {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: 1px solid var(--line);
}
.leak-banner.is-seen { background: color-mix(in srgb, #c98a2b 18%, var(--bone)); border-color: #c98a2b; }
.leak-banner.is-unseen { background: var(--sand); opacity: 0.85; }

.flow { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }
.flow-step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
  transition: border-color 0.15s ease;
}
.flow-step-icon { font-size: 1.1rem; flex-shrink: 0; }
.flow-step-label { font-weight: 600; }
.flow-step-status { color: var(--ink-soft); font-size: 0.82rem; margin-left: auto; text-align: right; }
.flow-branch {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  padding-left: 1.5rem;
  margin-left: 0.9rem;
  border-left: 2px solid var(--line);
}
.flow-step[data-status="running"] { border-color: var(--terracotta); }
.flow-step[data-status="running"] .flow-step-icon { animation: flow-pulse 1.2s ease-in-out infinite; }
.flow-step[data-status="done"] { border-color: var(--good); }
.flow-step[data-status="done"] .flow-step-status { color: var(--good); font-weight: 600; }
.flow-step[data-status="warn"], .flow-step[data-status="error"] { border-color: #b3402f; }
.flow-step[data-status="warn"] .flow-step-status, .flow-step[data-status="error"] .flow-step-status { color: #b3402f; font-weight: 600; }
.flow-step[data-status="skipped"] { opacity: 0.45; }
@keyframes flow-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.result-text { font-size: 0.88rem; line-height: 1.5; color: var(--ink); margin: 0 0 0.75rem; }
.result-group { font-weight: 700; text-transform: capitalize; }
.result-raw { margin-top: 0.5rem; }
.result-raw summary { cursor: pointer; font-size: 0.8rem; color: var(--ink-soft); }
.result-raw pre { white-space: pre-wrap; font-size: 0.78rem; color: var(--ink-soft); margin-top: 0.5rem; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.result-card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.result-card h3 { font-size: 1.05rem; margin-bottom: 1rem; }
.result-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.result-top-label { font-size: 1.3rem; font-weight: 700; text-transform: capitalize; }
.result-top-value { font-size: 1.1rem; font-weight: 700; color: var(--terracotta); }
.result-stage2 { margin-top: -0.5rem; opacity: 0.85; }
.result-stage2 .result-top-label { font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.result-stage2 .result-top-value { font-size: 0.9rem; color: var(--ink-soft); }
.result-stage2-pending .result-top-label { font-style: italic; opacity: 0.65; text-transform: none; }

/* ---------- árbol de etapas (página /probar.html) ---------- */
.stage-tree { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1.5rem; }
.stage-card {
  background: var(--bone-dim);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
  position: relative;
}
.stage-card[hidden] { display: none; }
.stage-card::before {
  content: "";
  position: absolute;
  left: 2.4rem;
  top: -1.5rem;
  width: 2px;
  height: 1.5rem;
  background: var(--line);
}
.stage-card:first-child::before { display: none; }
.stage-card-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.1rem;
}
.stage-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--terracotta);
  color: #fff;
  font-weight: 800;
  flex-shrink: 0;
}
.stage-card-header h3 { font-size: 1.2rem; flex: 1; }
.stage-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--sand);
}
.stage-badge.is-good { background: color-mix(in srgb, var(--good) 25%, var(--bone)); color: var(--good); }
.stage-badge.is-bad { background: color-mix(in srgb, #b3402f 25%, var(--bone)); color: #b3402f; }
.stage-badge.is-pending { opacity: 0.6; }
.stage-card-body { font-size: 0.95rem; }
.stage-card-note { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 1rem; }

.inner-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.inner-card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.inner-card h4 {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.inner-card.is-primary { border-color: var(--terracotta); border-width: 2px; }

.expert-empty {
  color: var(--ink-soft);
  font-style: italic;
  padding: 0.75rem 0;
}
.prob-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.45rem; font-size: 0.85rem; }
.prob-label { width: 130px; flex-shrink: 0; text-transform: capitalize; color: var(--ink-soft); }
.prob-bar-track { flex: 1; height: 8px; background: var(--sand); border-radius: 999px; overflow: hidden; }
.prob-bar-fill { height: 100%; background: var(--terracotta); border-radius: 999px; }
.prob-value { width: 42px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.result-empty { color: var(--ink-soft); font-size: 0.9rem; }
.result-viz { margin-top: 1rem; }
.result-viz-label { font-size: 0.78rem; color: var(--ink-soft); margin: 0 0 0.4rem; }
.result-viz-img { width: 100%; max-width: 220px; display: block; border-radius: 8px; cursor: zoom-in; background: #fff; }
.result-viz-img:hover { outline: 2px solid var(--terracotta); outline-offset: 2px; }

/* ---------- ampliar base de datos ---------- */
.ingest-form { display: flex; gap: 0.75rem; max-width: 640px; flex-wrap: wrap; }
.ingest-input {
  flex: 1;
  min-width: 240px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bone);
  color: var(--ink);
  font-size: 0.95rem;
}
.ingest-input:focus { outline: 2px solid var(--terracotta); outline-offset: 1px; }

.ingest-jobs { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 2rem; }
.ingest-job {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.ingest-job-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.ingest-job-title { font-weight: 700; font-size: 1.05rem; }
.ingest-job-meta { font-size: 0.82rem; color: var(--ink-soft); }
.ingest-job-status { font-size: 0.85rem; color: var(--terracotta); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.ingest-job-actions { display: flex; gap: 0.75rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.ingest-count { font-size: 0.85rem; color: var(--ink-soft); }

.ingest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.ingest-item {
  background: var(--bone-dim);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.72rem;
}
.ingest-item img { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #fff; border-radius: 6px; cursor: zoom-in; }
.ingest-item-name { display: block; margin-top: 0.35rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ingest-item-group { display: block; color: var(--ink-soft); text-transform: capitalize; }
.ingest-item-flag {
  margin-top: 0.35rem;
  font-size: 0.68rem;
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  cursor: pointer;
  color: var(--ink-soft);
}
.ingest-item-flag:hover { border-color: var(--terracotta); color: var(--terracotta); }
.ingest-item.is-accepted { opacity: 0.5; }
.ingest-item.is-review { border-color: var(--terracotta); }

/* ---------- identificación manual (tinder) ---------- */
.tinder-empty { color: var(--ink-soft); font-size: 0.95rem; }
.tinder-stack { max-width: 420px; }
.tinder-progress { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.75rem; }
.tinder-card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
}
.tinder-img { width: 100%; max-height: 320px; object-fit: contain; background: #fff; border-radius: 8px; cursor: zoom-in; }
.tinder-meta { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.2rem; }
.tinder-name { font-weight: 700; font-size: 1.1rem; }
.tinder-dims { font-size: 0.8rem; color: var(--ink-soft); }
.tinder-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1.25rem 0;
}
.tinder-group-btn {
  padding: 0.7rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bone);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: capitalize;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tinder-group-btn:hover { border-color: var(--terracotta); background: color-mix(in srgb, var(--terracotta) 8%, var(--bone)); }

/* ---------- infraestructura ---------- */
.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
.infra-card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--ink);
}
a.infra-card:hover { border-color: var(--terracotta); }
.infra-icon { font-size: 1.5rem; }
.infra-name { font-weight: 700; }
.infra-desc { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.4; }
.infra-meta { font-size: 0.85rem; }
.infra-path { font-size: 0.78rem; color: var(--ink-soft); font-style: italic; }
.tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--sand);
  color: var(--ink-soft);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem;
}

/* ---------- contacto ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.contact-card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--ink);
}
.contact-icon { font-size: 1.6rem; }
.contact-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.contact-value { font-weight: 600; }
a.contact-card:hover { border-color: var(--terracotta); }

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bone);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--line);
    display: none;
    gap: 1rem;
  }
  .nav-links.is-open { display: flex; }
  .nav-cta { align-self: flex-start; }
}

/* ---------- galería de taxón (data/stage2_taxon_cranio_viewer) ---------- */
.taxon-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.taxon-gallery-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--bone);
}
.taxon-gallery-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.taxon-gallery-header h4 {
  margin: 0;
  text-transform: capitalize;
}
.taxon-gallery-count {
  color: var(--ink);
  opacity: 0.6;
  font-size: 0.9rem;
  margin-left: auto;
}
.taxon-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.6rem;
}
.taxon-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--line);
  cursor: zoom-in;
}
.taxon-thumb.is-real {
  border-color: var(--terracotta);
}
}
