:root{
  --c-dev: #2A3854;
  --c-design: #DAD9C1;
  --c-brand: #4E463D;
  --c-systems: #A9B6C7;

  --ink-dark: #121417;
  --ink-light: #F5F6F7;

  --radius: 24px;
  --shadow: 0 18px 60px rgba(0,0,0,.18);
  --shadow-soft: 0 12px 40px rgba(0,0,0,.14);

  --glass: rgba(255,255,255,.72);
  --glass-dark: rgba(18,20,23,.55);
  --blur: saturate(140%) blur(12px);

  --maxw: 1120px;
  --pad: clamp(16px, 2.4vw, 28px);
  --ease: cubic-bezier(.2,.8,.2,1);

  --spot-x: 50%;
  --spot-y: 35%;

  /* para scroll-margin consistente */
  --header-h: 90px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--ink-dark);
  background: #0d0f12;
  overflow-x:hidden;
}

/* Subtle noise + vignette */
body::before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  background:
    radial-gradient(1200px 900px at 30% 0%, rgba(255,255,255,.06), transparent 55%),
    radial-gradient(900px 700px at 80% 20%, rgba(255,255,255,.04), transparent 60%),
    radial-gradient(900px 700px at var(--spot-x) var(--spot-y), rgba(255,255,255,.06), transparent 55%),
    radial-gradient(1200px 900px at 50% 120%, rgba(0,0,0,.55), transparent 55%);
  opacity: .9;
}

a{ color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible{
  outline: 3px solid rgba(255,255,255,.55);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ===== Header ===== */
.header{
  padding: 0;
  display:block;
  pointer-events:none;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 2000;
}
.header__inner{
  width: 100%;
  pointer-events:auto;

  border: 1px solid rgba(255,255,255,.14);
  border-left: 0;
  border-right: 0;

  background: rgba(13,15,18,.70);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);

  border-radius: 0 0 22px 22px;
  padding: 12px var(--pad);

  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.header__content{
  width: 100%;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  min-width: 180px;
}
.brand__mark{
  width: 34px; height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c-dev), var(--c-systems));
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.brand__name{
  font-weight: 750;
  letter-spacing: .2px;
  color: var(--ink-light);
  line-height: 1;
}
.brand__tag{
  display:block;
  font-weight: 500;
  font-size: 12px;
  opacity: .75;
  margin-top: 2px;
}
.nav{
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
}
.navlink{
  font-size: 13px;
  color: rgba(245,246,247,.88);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
  user-select:none;
  white-space:nowrap;
}
.navlink:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  transform: translateY(-1px);
}
.navlink.is-active{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.22);
}
.right{ display:flex; align-items:center; gap:10px; }

.lang{
  display:flex; gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}
.lang__btn{
  border: 1px solid transparent;
  background: transparent;
  color: rgba(245,246,247,.86);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor:pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.lang__btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.08); }
.lang__btn.is-active{
  background: rgba(245,246,247,.92);
  color: #111318;
  border-color: rgba(255,255,255,.65);
}

.btn{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.10);
  color: var(--ink-light);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  cursor:pointer;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); }
.btn--primary{
  background: rgba(245,246,247,.92);
  color: #111318;
  border-color: rgba(255,255,255,.65);
}
.btn--primary:hover{ background: #ffffff; }
.btn--ghost{
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.22);
 }

.scrollbar{
  width: min(var(--maxw), calc(100% - var(--pad) * 2));
  margin: 10px auto 0;
  height: 2px;
  border-radius: 99px;
  background: rgba(255,255,255,.10);
  overflow:hidden;
  pointer-events:none;
}
.scrollbar__fill{
  height:100%;
  width:0%;
  background: rgba(245,246,247,.72);
}

/* ===== Footer ===== */
.footer{
  position: fixed;
  inset: auto 0 0 0;
  z-index: 45;
  padding: 10px var(--pad);
  display:flex;
  justify-content:center;
  pointer-events:none;
}
.footer__inner{
  width: min(var(--maxw), calc(100% - var(--pad) * 2));
  pointer-events:auto;

  display:flex;
  gap: 12px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;

  border: 1px solid rgba(255,255,255,.14);
  background: rgba(13,15,18,.45);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: 16px;
  padding: 10px 12px;
  color: rgba(245,246,247,.85);
  font-size: 12px;
}
.footer__links{ display:flex; gap: 12px; flex-wrap:wrap; }
.footer__links a{ opacity:.9; border-bottom: 1px solid transparent; }
.footer__links a:hover{ border-bottom-color: rgba(245,246,247,.55); }

main{ position: relative; }

/* ===== Stage / Scroll ===== */
.stage{
  position: relative;
  height: 560vh;
  background: #0d0f12;
  z-index: 1;
}

.sticky{
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
  contain: layout paint; /* reduce reflow cost */
}

/* Grid base 2x2 */
.grid-base{
  position:absolute; inset:0;
  display:grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.base--dev{ background: var(--c-dev); }
.base--design{ background: var(--c-design); }
.base--brand{ background: var(--c-brand); }
.base--systems{ background: var(--c-systems); }

/* Hero overlay */
.hero{
  position:absolute;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 15;
  pointer-events:none;
}
.hero__inner{
  /*width: min(var(--maxw), calc(100% - var(--pad) * 2));*/
  padding: clamp(18px, 3vw, 28px);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(13,15,18,.38);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 24px 90px rgba(0,0,0,.35);

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero__kicker{
  align-self: flex-start;
  margin:0 0 10px 0;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: 12px;
  opacity:.85;
  color: rgba(245,246,247,.88);
}
.hero__title{
  margin:0;
  font-size: clamp(30px, 5vw, 62px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: rgba(245,246,247,.95);
}
.hero__subtitle{
  margin: 12px 0 0 0;
  max-width: 70ch;
  line-height: 1.55;
  font-size: clamp(14px, 1.6vw, 18px);
  color: rgba(245,246,247,.86);
}
.hero__actions{
  margin-top: 16px;
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content: center;
  pointer-events:auto;
}

/* Hint scroll */
.hint{
  position:absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(13,15,18,.35);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  color: rgba(245,246,247,.88);
  font-size: 12px;
  z-index: 16;
  user-select:none;
}
.dot{
  width: 8px; height: 8px; border-radius: 99px;
  background: rgba(245,246,247,.85);
  box-shadow: 0 0 0 4px rgba(245,246,247,.12);
  animation: pulse 1.8s infinite;
}
@keyframes pulse{
  0%, 100% { transform: scale(1); opacity:.9; }
  50% { transform: scale(1.18); opacity:.55; }
}

/* ===== Panels ===== */
.panel{
  position:absolute;
  overflow:hidden;
  transform: translateZ(0);
  will-change: left, top, width, height, opacity;
  border: 1px solid rgba(255,255,255,.10);
  z-index: 10;
  transition: transform .22s var(--ease);

  /* default state: stable layout (prevents CLS before JS) */
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
/* ===== Reduce CLS: posiciones iniciales antes de JS ===== */
/* Los .panel son abs dentro de .sticky (posicionado), así que % funciona */
.panel{
  left: 0;
  top: 0;
  width: 50%;
  height: 50%;
}

.panel[data-idx="1"]{ left: 50%; top: 0; }
.panel[data-idx="2"]{ left: 0; top: 50%; }
.panel[data-idx="3"]{ left: 50%; top: 50%; }
.panel:hover{ transform: translateY(-2px); }
.panel.is-open{
  border-radius: 0;
  box-shadow: var(--shadow);
  z-index: 50;
}

/* Initial 2x2 positions to prevent CLS before JS runs */
.panel--dev{ left:0; top:0; width:50%; height:50%; }
.panel--design{ left:50%; top:0; width:50%; height:50%; }
.panel--brand{ left:0; top:50%; width:50%; height:50%; }
.panel--systems{ left:50%; top:50%; width:50%; height:50%; }

.panel__inner{
  height:100%;
  display:flex;
  flex-direction:column;
  align-items: center;

  padding: clamp(18px, 3vw, 34px);
  padding-top: clamp(86px, 10vh, 140px);
  gap: 14px;

  justify-content: center; /* grid mode */
}
.panel.is-open .panel__inner{
  justify-content: flex-start; /* open mode */
}

.panel__head{
  width: min(78ch, 100%);
  text-align: left;
}

.panel__kicker{
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .8;
  margin:0 0 10px 0;
}
.panel__title{
  margin:0;
  font-size: clamp(26px, 4.2vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.panel__subtitle{
  margin: 10px 0 0 0;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.45;
  max-width: 60ch;
  opacity: .92;
}

/* Pills */
.pillbar{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content: flex-start;
}
.pill{
  font-size: 12px;
  border-radius: 999px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: .95;
  user-select:none;
}
.pillbtn{
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), opacity .18s var(--ease);
}
/* ===== Tabs a11y: refleja estado ARIA ===== */
.pillbtn[role="tab"][aria-selected="true"]{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.30);
}

.panel--design .pillbtn[role="tab"][aria-selected="true"],
.panel--systems .pillbtn[role="tab"][aria-selected="true"]{
  background: rgba(0,0,0,.10);
  border-color: rgba(0,0,0,.22);
}

.pillbtn.is-active{
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.30);
}
.panel--design .pillbtn.is-active,
.panel--systems .pillbtn.is-active{
  background: rgba(0,0,0,.08);
  border-color: rgba(0,0,0,.18);
}

/* Pills legibles en panels claros (Design + Systems) */
.panel--design .pillbtn,
.panel--systems .pillbtn{
  color: rgba(18,20,23,.92);        /* texto oscuro */
  background: rgba(0,0,0,.06);      /* fondo sutil */
  border-color: rgba(0,0,0,.18);    /* borde sutil */
}

.pillcontent{
  position: relative;
  width: min(72ch, 100%);
  margin-top: 6px;
  min-height: 74px; /* prevent jumps inside panel */
  text-align: left;
}
.pillpane{
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.pillpane.is-active{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.pillpane h3{
  margin: 0 0 6px 0;
  font-size: 14px;
  letter-spacing: .01em;
}
.pillpane p{
  margin: 0;
  line-height: 1.5;
  font-size: 13px;
  opacity: .92;
}

/* Details */
.panel__details{
  margin-top: 18px;
  display:grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
  align-items:start;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.panel.is-open .panel__details{
  opacity: 1;
  transform: translateY(0);
}
.card{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.12);
  padding: 14px 14px;
}
.card h3{
  margin:0 0 8px 0;
  font-size: 14px;
  letter-spacing: .01em;
}
.card ul{
  margin:0; padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  opacity: .95;
}
.card p{
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  opacity: .95;
}

/* Panel colors */
.panel--dev{ background: var(--c-dev); color: var(--ink-light); }
.panel--brand{ background: var(--c-brand); color: var(--ink-light); }
.panel--design{ background: var(--c-design); color: var(--ink-dark); border-color: rgba(0,0,0,.10); }
.panel--systems{ background: var(--c-systems); color: var(--ink-dark); border-color: rgba(0,0,0,.10); }

.panel--design .pill, .panel--systems .pill,
.panel--design .card, .panel--systems .card{
  border-color: rgba(0,0,0,.14);
  background: rgba(255,255,255,.45);
}

/* ===== Content ===== */
.content{
  background: #0d0f12;
  color: rgba(245,246,247,.92);
  padding: var(--pad) 25px;
}
.content__inner{
  width: min(var(--maxw), 100%);
  margin: 0 auto;
}
.section{
  padding: 42px 0;
  border-top: 1px solid rgba(255,255,255,.10);
}
.section h2{
  margin:0 0 10px 0;
  font-size: clamp(22px, 2.8vw, 34px);
  letter-spacing: -0.02em;
}
.section p{
  margin: 0;
  max-width: 78ch;
  line-height: 1.65;
  opacity: .9;
}
.muted{ opacity:.85; margin-top: 8px; }

/* Form */
.form{ margin-top: 16px; }
.form__grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.field{ display:flex; flex-direction:column; gap: 8px; }
.field--full{ grid-column: 1 / -1; }

/* Servicios: 2x2 (label / pills+hint) + fila oculta para sentinel */
.field--services{
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label  label"
    "pills  hint"
    "hidden hidden";
  gap: 10px 12px;
  align-items: start;
}

#serviceLabel{ grid-area: label; }
#servicePills{ grid-area: pills; }

#serviceHint{
  grid-area: hint;
  align-self: center;
  justify-self: end;
  margin: 0;
  white-space: nowrap;
}

/* El sentinel no debe “empujar” visualmente el layout */
#serviceHidden{
  grid-area: hidden;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* En pantallas estrechas, el hint baja debajo */
@media (max-width: 520px){
  .field--services{
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "pills"
      "hint"
      "hidden";
  }
  #serviceHint{
    justify-self: start;
    white-space: normal;
  }
}


.field span{ font-size: 12px; letter-spacing:.02em; opacity:.9; }

input, textarea, select{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: rgba(245,246,247,.92);
  padding: 12px 12px;
  font-size: 14px;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
input:hover, textarea:hover, select:hover{ background: rgba(255,255,255,.08); }
input:focus, textarea:focus, select:focus{ border-color: rgba(245,246,247,.55); }

.form__actions{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.form__status {
  font-size: 13px;
  opacity:.9;
  flex: 1 1 100%;
  order: 2;
  margin-top: 6px;
}
#submitBtn{
  order: 0;
}
.form__fineprint{ order: 1; font-size: 12px; opacity:.75; margin: 0; }
.hp{ display:none !important; }

/* Service pills */
.service-pills{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-start;
}
.pillbtn, .servicepill{
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color: rgba(245,246,247,.92);
}
.servicepill:hover{
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.22);
}
.servicepill.is-selected{
  background: rgba(245,246,247,.92);
  color: #111318;
  border-color: rgba(255,255,255,.65);
}

/* Dialog */
dialog{
  width: min(640px, calc(100% - var(--pad) * 2));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  padding: 0;
  color: rgba(245,246,247,.92);
  background: rgba(13,15,18,.78);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 30px 120px rgba(0,0,0,.55);
}
dialog::backdrop{ background: rgba(0,0,0,.55); }
.dlg{ padding: 18px; }
.dlg__head{
  display:flex; align-items:flex-start; justify-content:space-between; gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.dlg__head h3{ margin:0; font-size: 16px; letter-spacing: .01em; }
.dlg__hint{ opacity:.82; font-size:13px; margin-top:6px; line-height:1.45; }
.dlg__body{
  padding-top: 14px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dlg__body a{
  display:block;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  padding: 12px;
  background: rgba(255,255,255,.06);
}
.dlg__body a:hover{ background: rgba(255,255,255,.10); }
.dlg__body small{ display:block; opacity:.8; margin-top: 4px; line-height: 1.35; }
.dlg__foot{ margin-top: 12px; display:flex; justify-content:flex-end; gap: 10px; }

/* Scroll offsets */
#home, #services, #about, #contact{
  scroll-margin-top: calc(var(--header-h) + 12px);
}

/* Cookies banner */
.cookie{
  position: fixed;
  left: 0; right: 0;
  bottom: 66px;
  z-index: 3000;
  display:flex;
  justify-content:center;
  padding: 0 var(--pad);
}
.cookie__inner{
  width: min(var(--maxw), 100%);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(13,15,18,.72);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: 16px;
  box-shadow: 0 24px 90px rgba(0,0,0,.35);
  color: rgba(245,246,247,.92);
  padding: 12px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}
.cookie__text strong{ display:block; margin-bottom: 4px; }
.cookie__text p{ margin:0; opacity:.9; line-height:1.45; max-width: 78ch; font-size: 13px; }
.cookie__actions{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.cookie__link{
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: rgba(245,246,247,.95);
  border-bottom-color: rgba(245,246,247,.45)
}
.cookie__link:hover{ border-bottom-color: rgba(245,246,247,.75); }
.cookie__link:focus-visible{
  outline: 3px solid rgba(255,255,255,.55);
  outline-offset: 3px;
  border-radius: 10px;
}
.cookie[hidden] { display: none !important; }

/* =========================
   A11Y CONTRAST FIXES
   (footer + ghost buttons over light panels)
   ========================= */

/* Footer: más opaco (evita que el panel claro “se coma” el contraste) */
.footer__inner{
  background: rgba(13,15,18,.82); /* antes .45 */
  border-color: rgba(255,255,255,.18);
  color: rgba(245,246,247,.94);   /* antes .85 */
}

/* Links dentro del footer: sin opacidades “castigadoras” */
.footer__inner a,
.footer__links a{
  opacity: 1;                     /* antes .9 */
  color: rgba(245,246,247,.95);
  border-bottom-color: rgba(245,246,247,.28);
}
.footer__inner a:hover,
.footer__links a:hover{
  border-bottom-color: rgba(245,246,247,.70);
}

/* Focus visible claro en footer */
.footer__inner a:focus-visible{
  outline: 3px solid rgba(245,246,247,.70);
  outline-offset: 3px;
  border-radius: 10px;
}

/* CTA ghost: fondo oscuro estable (no depende del color del panel debajo) */
.btn--ghost{
  background: rgba(0,0,0,.28);
  border-color: rgba(255,255,255,.22);
  color: rgba(245,246,247,.96);
}
.btn--ghost:hover{
  background: rgba(0,0,0,.36);
  border-color: rgba(255,255,255,.30);
}

/* ===== Header mobile layout (2 filas reales) ===== */
@media (max-width: 640px){
  .header__content{
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }

  /* Marca NO a 100% (evita 3 filas) */
  .brand{
    flex: 0 1 auto;
    min-width: 0;
  }
  .brand__tag{ display: none; }

  /* “Desempaqueta” .right para que sus hijos sean items del flex */
  .right{ display: contents; }

  /* Idioma a la derecha */
  .lang{ margin-left: auto; }

  /* CTA en 2ª fila, ancho completo */
  .header__content > a.btn--primary{
    flex: 1 1 100%;
    text-align: center;
  }

  /* Compactar un poco */
  .btn{ padding: 9px 12px; font-size: 12px; }
  .lang{ padding: 4px; }
  .lang__btn{ padding: 7px 9px; }
}

/* En pantallas muy estrechas, el CTA principal en ancho completo */
@media (max-width: 420px){
  .header .right > a.btn--primary{
    flex: 1 1 100%;
    text-align: center;
  }
}

/* Responsive */
@media (max-width: 980px){
  .nav{ display:none; }
}
@media (max-width: 860px){
  .brand{ min-width: unset; }
  .panel__details{ grid-template-columns: 1fr; }
  .dlg__body{ grid-template-columns: 1fr; }
  .form__grid{ grid-template-columns: 1fr; }
  .hint{ bottom: 96px; }
  .cookie__inner{ flex-direction: column; align-items: flex-start; }
  .cookie__actions{ justify-content:flex-start; }
  .footer{
    position: static;
    inset: auto;
    z-index: auto;
    pointer-events: auto;
    padding: var(--pad) 24px;
    /*margin-top: 16px;*/
  }
  .footer__inner{
    width: min(var(--maxw), 100%);
    margin: 0 auto;
  }

  /* Ajuste opcional: el banner de cookies ya no necesita “subirse” por el footer fijo */
  .cookie{ bottom: 16px; }
  .panel.is-open .panel__inner{
    padding-top: calc(var(--header-h) + 16px);
  }
  .panel.is-open{
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }
}

/* Hover SOLO en dispositivos con hover real (ratón/trackpad) */
@media (hover: hover) and (pointer: fine){
  .pillbtn:hover{
    transform: translateY(-1px);
    opacity: 1;
  }

  .panel--design .pillbtn:hover,
  .panel--systems .pillbtn:hover{
    background: rgba(0,0,0,.10);
    border-color: rgba(0,0,0,.24);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .dot{ animation:none; }
  .panel, .panel__details, .btn, .navlink, input, textarea, select{ transition:none !important; }
}
