@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --yellow: #ffc400;
  --ink: #1a1a1a;
  --dark: #1e1e1c;
  --cream: #f5f3ee;
  --white: #ffffff;
  --line: #d9d4c7;
  --muted: #3d3c38;
  --on-dark: #d3d3ce;
  --dark-line: #44433e;
  --dark-card: #282826;
  --shadow: 0 6px 24px rgba(30, 30, 28, 0.1);
  --max: 75rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section: clamp(3rem, 8vw, 6rem);
  --f-h2: clamp(1.625rem, 1.1rem + 2vw, 2.5rem);
  --f-h3: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
  --f-lead: clamp(1.25rem, 1rem + 1vw, 1.75rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
section[id] { scroll-margin-top: 4.5rem; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-optical-sizing: auto;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  overflow-wrap: break-word;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.wrap { width: min(100%, var(--max)); margin-inline: auto; padding-inline: var(--gutter); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.dark :focus-visible, .site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--yellow); }
.skip { position: absolute; left: 0.5rem; top: -4rem; z-index: 30; background: var(--ink); color: var(--white); padding: 0.6rem 0.9rem; border-radius: 0.5rem; }
.skip:focus { top: 0.5rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header (sticky, charcoal) ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--dark); color: var(--white); border-bottom: 1px solid #3a3a37; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; padding-block: 0.5rem; }
.brand { position: relative; display: inline-block; line-height: 0; }
.brand img { width: 8.5rem; height: auto; filter: invert(1); }
/* Guiño: las ruedas del robot son los "ojos"; se tapan y se aplastan un instante, como al final del vídeo de demostración */
.eye { position: absolute; top: 88.04%; width: 7.2%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: var(--dark); opacity: 0; pointer-events: none; }
.eye::after { content: ""; position: absolute; inset: 4.5%; border-radius: 50%; background: var(--white); transform: scaleY(1); }
.eye-l { left: 7.92%; }
.eye-r { left: 25.83%; }
@keyframes blink-eye { 0%, 100% { opacity: 0; } 4%, 92% { opacity: 1; } }
@keyframes blink-lid { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(0.14); } }
/* El parpadeo lo dispara main.js en momentos aleatorios (no hay efecto al pasar el ratón) */
.brand.blink .eye { animation: blink-eye 0.5s 1; }
.brand.blink .eye::after { animation: blink-lid 0.5s 1; }
.bar-end { display: flex; align-items: center; gap: 0.25rem; }
.lang { display: flex; align-items: center; gap: 0.125rem; font-weight: 700; font-size: 0.875rem; letter-spacing: 0.04em; }
.lang a { text-decoration: none; padding: 0.75rem 0.5rem; border-radius: 0.375rem; color: #c9c6bb; }
.lang a[aria-current="true"] { color: var(--white); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.lang a:hover { color: var(--white); }
.lang span { color: #6b6a63; }
.menu-toggle { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; background: transparent; border: 0; color: var(--white); cursor: pointer; border-radius: 0.5rem; padding: 0; }
.menu-toggle[hidden] { display: none; }
.menu-toggle svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav { order: 3; flex-basis: 100%; }
.nav ul { display: flex; flex-wrap: wrap; gap: 0 0.25rem; padding-bottom: 0.5rem; }
.nav a { display: block; padding: 0.6rem 0.7rem; font-weight: 600; font-size: 0.9375rem; text-decoration: none; color: #e6e3d9; }
.nav a:hover { color: var(--white); }
.nav a[aria-current="true"] { color: var(--white); box-shadow: inset 0 -3px 0 var(--yellow); }
/* With JS the mobile nav is collapsed (in normal flow, no overlay) */
.js .nav { display: none; }
.js .nav.open { display: block; }
.js .nav ul { flex-direction: column; padding-bottom: 0.75rem; }
@media (min-width: 56rem) {
  .nav { order: 0; flex-basis: auto; margin-left: auto; }
  .nav ul { padding-bottom: 0; }
  .js .nav, .js .nav.open { display: block; }
  .js .nav ul { flex-direction: row; }
  .menu-toggle { display: none !important; }
}

/* ---------- Type ---------- */
h1, .h2, h3 { font-weight: 800; letter-spacing: -0.025em; line-height: 1.12; }
.h2 { font-size: var(--f-h2); padding-left: 1rem; border-left: 0.375rem solid var(--yellow); margin-bottom: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: var(--f-h3); letter-spacing: -0.02em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--yellow); color: var(--ink);
  font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; text-decoration: none; text-align: center;
  padding: 0.85rem 1.4rem; border-radius: 999px; border: 2px solid var(--yellow);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.dark .btn:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.dark .btn-ghost { color: var(--white); border-color: var(--white); }
.dark .btn-ghost:hover { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

/* ---------- Dark sections ---------- */
.dark { background: var(--dark); color: var(--white); }
section.dark, section.how, section.team, .hero { padding-block: var(--section); }

/* ---------- Hero ---------- */
.hero-copy { padding-top: 2.26rem; } /* mantiene el aire que ocupaba la antigua etiqueta */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: clamp(1.5rem, 5vw, 3.5rem); align-items: center; }
.hero h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.875rem); line-height: 1.08; max-width: 20ch; margin-bottom: 1rem; }
.hero-accent { font-size: var(--f-lead); font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 1.25rem; }
.hero-accent span { background: linear-gradient(transparent 58%, var(--yellow) 58%); -webkit-box-decoration-break: clone; box-decoration-break: clone; padding-inline: 0.15em; margin-inline: -0.15em; }
.hero-text { color: var(--muted); max-width: 36rem; margin-bottom: 1.75rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.vcard { position: relative; border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; background: var(--white); aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.vcard video { width: 100%; height: 100%; object-fit: cover; }
.vexpand { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.vexpand[hidden] { display: none; }
.vexpand:focus-visible { outline-offset: -6px; outline-color: var(--ink); }
.vzoom { position: absolute; right: 0.6rem; top: 0.6rem; width: 2rem; height: 2rem; border-radius: 0.5rem; background: var(--ink); color: var(--white); display: grid; place-items: center; pointer-events: none; }
.vzoom svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vbtn { position: absolute; left: 0.6rem; bottom: 0.6rem; width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--white); border: 2px solid var(--white); cursor: pointer; padding: 0; z-index: 2; }
.vbtn[hidden] { display: none; }
.vbtn svg { fill: currentColor; }
.vbtn .i-play { display: none; }
.vbtn.is-paused .i-play { display: block; }
.vbtn.is-paused .i-pause { display: none; }
.vbtn:focus-visible { outline-color: var(--yellow); }

/* Lightbox (native <dialog>) */
.vdialog { border: 0; padding: 0; background: transparent; width: min(68.75rem, 94vw); max-width: none; max-height: 100svh; overflow: visible; color: var(--white); }
.vdialog::backdrop { background: rgba(10, 10, 10, 0.86); }
.vbar { display: flex; justify-content: flex-end; padding-bottom: 0.5rem; }
.vclose { width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 2px solid var(--white); background: var(--dark); color: var(--white); display: grid; place-items: center; cursor: pointer; padding: 0; }
.vclose svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.vdialog video { width: min(100%, calc((100svh - 5rem) * 16 / 9)); margin-inline: auto; aspect-ratio: 16 / 9; background: var(--white); border-radius: 0.75rem; }

/* ---------- Problem: cadena de montaje ASCII (4 filas, sobre carbón) ---------- */
.line { position: relative; margin-top: clamp(3.25rem, 7vw, 4.5rem); }
.line pre { margin: 0; font: clamp(0.6875rem, 0.45rem + 0.6vw, 0.9375rem)/1.3 ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; letter-spacing: 0; font-variant-ligatures: none; font-kerning: none; font-synthesis: none; white-space: pre; overflow: hidden; min-height: calc(4 * 1.3em); color: var(--on-dark); }
.line .dim { opacity: 0.6; }
.line .hi { color: var(--white); }
.line .part { color: var(--yellow); }
.lpause { position: absolute; right: 0; top: -2.5rem; width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--dark-line); background: var(--dark); color: var(--white); cursor: pointer; padding: 0; }
.lpause[hidden] { display: none; }
.lpause svg { fill: currentColor; }
.lpause .i-play { display: none; }
.lpause.is-paused .i-play { display: block; }
.lpause.is-paused .i-pause { display: none; }
.lpause:hover { border-color: var(--white); }

/* ---------- Problem (dark) ---------- */
.intro { font-size: clamp(1.0625rem, 0.9rem + 0.7vw, 1.375rem); font-weight: 600; letter-spacing: -0.015em; line-height: 1.45; max-width: 62rem; margin-top: 0; margin-bottom: clamp(1.75rem, 5vw, 3rem); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: clamp(2rem, 5vw, 3.5rem); }
.col { border-top: 3px solid var(--yellow); padding-top: 1.25rem; }
.col h3 { font-size: 0.9375rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--on-dark); margin-bottom: 0.75rem; }
.col-problem { color: var(--on-dark); margin-bottom: 1.5rem; }
.col .lead { font-size: var(--f-lead); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 1.25rem; }
.ticks { display: grid; gap: 0.65rem; }
.ticks li { position: relative; padding-left: 1.75rem; color: #e6e6e1; }
.ticks li::before { content: ""; position: absolute; left: 0.1rem; top: 0.5em; width: 0.75rem; height: 0.45rem; border-left: 3px solid var(--yellow); border-bottom: 3px solid var(--yellow); transform: rotate(-45deg); }

/* ---------- How it works ---------- */
.how-intro { max-width: 46rem; margin-bottom: clamp(2rem, 5vw, 3rem); color: var(--muted); }
.steps { display: grid; gap: clamp(2rem, 6vw, 3rem); }
.step { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: clamp(1.25rem, 4vw, 3.5rem); align-items: center; }
.step img, .step .vcard { width: 100%; border-radius: 0.875rem; border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow); }
.tag { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; padding: 0.25rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tag .dot { background: var(--yellow); border-color: var(--ink); }
.step h3 { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.num { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--ink); color: var(--yellow); font-size: 1.0625rem; font-weight: 800; letter-spacing: 0; }
.step-body p { max-width: 34rem; }
@media (min-width: 56rem) { .step:nth-child(even) > img, .step:nth-child(even) > .vcard { order: 2; } }

/* ---------- Status (dark, prose) ---------- */
.prose-dark { max-width: 46rem; }
.prose-dark p { color: var(--on-dark); font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.25rem); line-height: 1.6; }
.prose-dark p + p { margin-top: 1.25rem; }

/* ---------- Team ---------- */
.person { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1.5rem clamp(1.5rem, 5vw, 2.5rem); align-items: start; }
@media (min-width: 48rem) { .person { grid-template-columns: auto 1fr; } }
.photo { width: 11rem; height: 11rem; border-radius: 50%; object-fit: cover; border: 3px solid var(--white); box-shadow: var(--shadow); background: var(--white); }
.person h3 { margin-bottom: 0.75rem; }
.where { font-weight: 600; color: var(--muted); letter-spacing: -0.01em; }
.bio { max-width: 46rem; margin-bottom: 1rem; }
.link { font-weight: 700; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.link:hover { text-decoration-color: var(--yellow); }
.logos { margin-top: clamp(2rem, 6vw, 3rem); padding-top: 1.75rem; border-top: 1px solid var(--line); }
.logos ul { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.logos .grp { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.logos .sep { width: 1px; height: 1.4rem; background: var(--line); }
.lg { width: auto; filter: grayscale(1); opacity: 0.75; }
.lg-unizar, .lg-tubs { height: 1.625rem; }
.lg-unir { height: 2.0625rem; }
.lg-fraunhofer, .lg-keba { height: 0.9375rem; }
.lg-dragandbot { height: 1.1875rem; }

/* ---------- Get involved (dark) ---------- */
.involve-intro { font-size: var(--f-lead); font-weight: 600; line-height: 1.35; max-width: 42rem; margin-bottom: 2rem; }
.chip { display: inline-flex; align-items: center; gap: 0.5rem; vertical-align: middle; margin-left: 0.25rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-dark); border: 1px solid #55544e; border-radius: 999px; padding: 0.25rem 0.75rem; }
.dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; border: 2px solid var(--yellow); flex: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.25rem; }
.card { display: flex; flex-direction: column; gap: 0.75rem; padding: clamp(1.25rem, 3vw, 1.75rem); border: 1px solid var(--dark-line); border-radius: 1rem; background: var(--dark-card); }
.card h3 { font-size: var(--f-h3); }
.card p:nth-of-type(1) { color: var(--on-dark); flex: 1; }
.card .btn { margin-top: 0.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: var(--on-dark); border-top: 1px solid #3a3a37; padding-block: 2rem 2.5rem; font-size: 0.9375rem; }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2rem; }
.foot-logo { filter: invert(1); width: 7rem; height: auto; }
.foot-tag { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; font-weight: 700; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-left: auto; }
.foot-links a { color: var(--white); text-underline-offset: 4px; padding: 0.375rem 0; display: inline-block; }

/* ---------- Privacy ---------- */
.prose { padding-block: 1.5rem 5rem; max-width: 47.5rem; }
.prose h1 { font-size: var(--f-h2); margin: 1.5rem 0 0.5rem; }
.prose h2 { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; margin: 2.25rem 0 0.5rem; }
.prose p { margin-top: 0.6rem; }
.prose a { font-weight: 700; text-underline-offset: 4px; }
.muted { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .eye, .eye::after { animation: none; }
  .btn { transition: none; }
}
