/* ========================================================================== 
   José Manuel SG — jmsegarcv.com
   Interfaz profesional, bilingüe, responsive y sin dependencias externas
   ========================================================================== */

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

:root {
  color-scheme: light;
  --bg: #f4efe6;
  --bg-alt: #ebe4d5;
  --surface: #fbf8f1;
  --surface-strong: #ffffff;
  --text: #2b261f;
  --muted: #6b6255;
  --line: #dcd1bd;
  --accent: #1f4e79;
  --accent-strong: #173b5c;
  --on-accent: #ffffff;
  --accent-soft: rgba(31, 78, 121, .10);
  --accent-2: #8a551b;
  --on-accent-2: #ffffff;
  --ok: #35672d;
  --err: #a23328;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-soft: 0 8px 24px rgba(70, 56, 34, .08);
  --shadow: 0 14px 42px rgba(70, 56, 34, .12);
  --header-border: rgba(120, 102, 72, .25);
  --container: 1580px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-alt: #0f1830;
  --surface: #131d33;
  --surface-strong: #18243d;
  --text: #edf2fb;
  --muted: #a5b2ca;
  --line: #273757;
  --accent: #89b4ff;
  --accent-strong: #a8c9ff;
  --on-accent: #0b1220;
  --accent-soft: rgba(137, 180, 255, .14);
  --accent-2: #f1bd58;
  --on-accent-2: #18130a;
  --ok: #86d3a4;
  --err: #ff9f99;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .24);
  --shadow: 0 14px 42px rgba(0, 0, 0, .34);
  --header-border: rgba(116, 144, 190, .24);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-width: 280px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
}

html:not([data-lang]) .lang-en,
html[data-lang="es"] .lang-en,
html[data-lang="en"] .lang-es { display: none !important; }

[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
svg { max-width: 100%; }
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

main { min-height: 60vh; }
section[id] { scroll-margin-top: 126px; }

h1, h2, h3 {
  margin: 0 0 .62em;
  line-height: 1.2;
  letter-spacing: -.018em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 5vw, 3.65rem); font-weight: 800; }
h2 { font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 700; color: var(--accent); }

h2::after {
  content: "";
  display: block;
  width: 62px;
  height: 4px;
  margin-top: .58rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.22rem; }
li + li { margin-top: .3rem; }
strong { font-weight: 750; }
em { font-style: italic; }
code {
  padding: .12rem .34rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--text);
  font-size: .9em;
}

::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

a { color: var(--accent); text-underline-offset: .17em; }
a:hover { color: var(--accent-strong); }

.skip {
  position: fixed;
  left: .8rem;
  top: -5rem;
  z-index: 300;
  padding: .7rem 1rem;
  border-radius: 0 0 10px 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  transition: top .18s ease;
}
.skip:focus { top: 0; }

.container { width: min(var(--container), 92%); margin-inline: auto; }
.section { padding: 4.35rem 0; }
.section-alt { background: var(--bg-alt); }

.kicker {
  margin-bottom: .42rem;
  color: var(--accent-2);
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.lead {
  max-width: 70ch;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.7vw, 1.14rem);
  line-height: 1.72;
}

.muted { color: var(--muted); }
.group-label {
  margin: 1.08rem 0 .52rem;
  color: var(--accent-2);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.content-grid,
.project-grid { margin-top: 1.5rem; }
.compact-block { margin-bottom: .42rem; }
.callout-spaced { margin-top: 1.4rem; }
.project-tags { margin-bottom: 1rem; }
.project-note { margin-top: 1.4rem; font-size: .9rem; }
.project-status { margin: .95rem 0 0; }
.interest-tags { margin-top: 1rem; }
.form-actions { margin: 1rem 0 0; }
.contact-meta { margin: 0; font-size: .88rem; }
.location-line { margin: 1rem 0 0; font-size: .85rem; }
.location-icon { width: 14px; height: 14px; vertical-align: -2px; }

/* -------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .52rem;
  min-height: 44px;
  padding: .72rem 1.18rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: .62; transform: none; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { color: var(--on-accent); box-shadow: 0 7px 20px rgba(31, 78, 121, .25); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

.chip {
  display: inline-block;
  margin: 0 .34rem .46rem 0;
  padding: .29rem .7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .79rem;
  font-weight: 700;
  line-height: 1.35;
}
.chip-neutral { border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.chip-prep { border: 1px dashed var(--accent); }
.chip-current { background: var(--accent-2); color: var(--on-accent-2); font-weight: 800; }

/* -------------------------------- Header --------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--header-border);
  background: var(--bg);
}

@supports (backdrop-filter: blur(12px)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px) saturate(1.12);
  }
}

.nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .68rem;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand-badge {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  box-shadow: var(--shadow-soft);
  font-size: .88rem;
  font-weight: 850;
}
.brand-text { min-width: 0; line-height: 1.15; white-space: nowrap; }
.brand-text small { display: block; margin-top: .15rem; color: var(--muted); font-size: .71rem; font-weight: 600; }

.nav-carousel {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-left: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: .16rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-menu li { flex: 0 0 auto; margin: 0; }
.nav-menu a {
  display: block;
  padding: .5rem .67rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}
.nav-menu a:hover,
.nav-menu a[aria-current="location"] {
  background: var(--accent-soft);
  color: var(--text);
}
.nav-menu a[aria-current="location"] { box-shadow: inset 0 -2px 0 var(--accent); }

.nav-scroll {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.nav-scroll svg { width: 17px; height: 17px; }
.nav-scroll:disabled { cursor: default; opacity: .25; }

.nav-actions { display: flex; align-items: center; gap: .42rem; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: .78rem;
  font-weight: 800;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }
#themeToggle .icon-sun { display: none; }
[data-theme="dark"] #themeToggle .icon-sun { display: block; }
[data-theme="dark"] #themeToggle .icon-moon { display: none; }

/* --------------------------------- Hero ---------------------------------- */
.hero {
  position: relative;
  overflow: clip;
  padding: 4.7rem 0 3.15rem;
  background:
    radial-gradient(circle at 87% 12%, var(--accent-soft), transparent 34%),
    radial-gradient(circle at 8% 94%, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 30%);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .82fr);
  align-items: start;
  gap: 2.35rem;
}
.hero h1 { margin-bottom: .25rem; }
.hero-role { max-width: 850px; margin: 0 0 1.05rem; font-size: clamp(1.05rem, 2vw, 1.19rem); font-weight: 700; }
.hero-role em { color: var(--accent-2); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .72rem; margin-top: 1.55rem; }

.panel,
.card,
.stat,
.t-item {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel { padding: 1.48rem; border-radius: var(--radius-lg); }
.panel h3 { margin-bottom: .36rem; font-size: 1rem; }

.cred-list { display: grid; gap: .68rem; margin: 0; padding: 0; list-style: none; }
.cred-list li { display: flex; align-items: flex-start; gap: .62rem; margin: 0; font-size: .91rem; }
.cred-list svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: .24rem; color: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .95rem; margin-top: 2.65rem; }
.stat { padding: 1.05rem 1.15rem; border-radius: var(--radius); }
.stat b { display: block; margin-bottom: .12rem; color: var(--accent); font-size: 1.28rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .82rem; line-height: 1.45; }

/* ----------------------------- Cards / grids ------------------------------ */
.grid { display: grid; gap: 1.18rem; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card { padding: 1.38rem; border-radius: var(--radius); }
.card h3 { margin-bottom: .36rem; }
.card p { margin-bottom: .82rem; color: var(--muted); font-size: .93rem; }
.card ul { font-size: .93rem; }
.card .icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: .9rem;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card .icon svg { width: 21px; height: 21px; }
.cols-3 .card { height: 100%; }

.callout {
  padding: 1rem 1.16rem;
  border-left: 4px solid var(--accent-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-soft);
  font-size: .95rem;
}

.tags { display: flex; flex-wrap: wrap; gap: .34rem; }
.tags span {
  padding: .19rem .54rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-alt);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.35;
}

/* -------------------------------- Timeline ------------------------------- */
.timeline {
  display: grid;
  gap: 1.35rem;
  margin-top: 2rem;
  padding-left: 1.58rem;
  border-left: 2px solid var(--line);
}
.t-item { position: relative; padding: 1.3rem 1.38rem; border-radius: var(--radius); }
.t-item::before {
  content: "";
  position: absolute;
  left: -2.08rem;
  top: 1.48rem;
  width: 12px;
  height: 12px;
  border: 3px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
}
.section-alt .t-item::before { border-color: var(--bg-alt); }
.t-item.current {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 55%);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-soft);
}
.t-item.current::before { background: var(--accent-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.t-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: .25rem; }
.t-role { font-size: 1.02rem; font-weight: 800; }
.t-period {
  padding: .21rem .65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .79rem;
  font-weight: 800;
  white-space: nowrap;
}
.t-company { margin-bottom: .55rem; color: var(--muted); font-size: .9rem; font-weight: 650; }
.t-item ul { margin: .45rem 0 .95rem; padding-left: 1.15rem; }
.t-item li { margin-bottom: .38rem; font-size: .93rem; }

/* --------------------------------- Forms --------------------------------- */
.contact-form { align-self: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; margin-bottom: .32rem; font-size: .87rem; font-weight: 700; }

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--text);
  padding: .72rem .84rem;
}
input:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
input:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 145px; resize: vertical; }
.hint { margin: .3rem 0 0; color: var(--muted); font-size: .79rem; }
.consent { display: flex; align-items: flex-start; gap: .62rem; color: var(--muted); font-size: .84rem; }
.consent input { margin-top: .3rem; flex: 0 0 auto; }
.consent-label { margin: 0; font-weight: 450; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; opacity: 0 !important; }
.form-status { margin-top: 1rem; padding: .82rem 1rem; border-radius: 10px; background: var(--accent-soft); font-size: .89rem; font-weight: 700; }
.form-status.success { color: var(--ok); }
.form-status.error { color: var(--err); }
.form-status.sending { color: var(--muted); }
.contact-actions { display: grid; gap: .62rem; }

.training-details {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}
.training-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--accent);
  font-size: .9rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.training-details summary::-webkit-details-marker { display: none; }
.training-details summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
}
.training-details[open] summary::after { content: "–"; }
.training-details[open] summary { margin-bottom: .75rem; }
.training-details-content > :last-child { margin-bottom: 0; }

/* ---------------------------------- Legal -------------------------------- */
.legal-main { padding-top: 3.7rem; }
.legal { max-width: 78ch; }
.legal h1 { font-size: clamp(2rem, 4vw, 3rem); }
.legal h2 { margin-top: 2.25rem; font-size: 1.25rem; }
.legal p,
.legal li,
.legal dd { font-size: .96rem; }
.legal-data { display: grid; gap: .62rem; margin: 1.25rem 0 1.35rem; }
.legal-data > div {
  display: grid;
  grid-template-columns: minmax(135px, .34fr) minmax(0, 1fr);
  gap: .8rem;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.legal-data dt { color: var(--accent); font-size: .83rem; font-weight: 800; }
.legal-data dd { margin: 0; overflow-wrap: anywhere; }
.legal-table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.legal-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.legal-table th,
.legal-table td { padding: .82rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .9rem; }
.legal-table th { background: var(--accent-soft); color: var(--text); font-weight: 800; }
.legal-table tr:last-child td { border-bottom: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: .58rem; margin-top: 2.5rem; }

/* --------------------------------- Footer -------------------------------- */
.site-footer { margin-top: 0; padding: 2.1rem 0; border-top: 1px solid var(--line); background: var(--bg-alt); }
.footer-grid { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; color: var(--muted); font-size: .86rem; }
.footer-grid p { margin: 0; }
.footer-grid nav { display: flex; flex-wrap: wrap; gap: .95rem 1.12rem; }
.footer-grid a[aria-current="page"] { color: var(--text); font-weight: 800; }

/* ------------------------------- Back to top ------------------------------ */
.back-to-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--accent);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--accent); color: var(--on-accent); }
.back-to-top svg { width: 21px; height: 21px; }

/* -------------------------- Visibilidad progresiva ------------------------- */
/* El contenido permanece siempre visible, incluso si JavaScript, IntersectionObserver
   o las preferencias del navegador impiden ejecutar animaciones de entrada. */
.reveal,
.reveal.visible,
.js .reveal,
.js .reveal.visible { opacity: 1; transform: none; }

/* -------------------------------- Responsive ------------------------------ */
@media (max-width: 1040px) {
  .nav-menu a { padding-inline: .53rem; font-size: .85rem; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(285px, .75fr); }
}

@media (max-width: 920px) {
  section[id] { scroll-margin-top: 132px; }
  .nav {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .5rem .75rem;
    padding: .5rem 0 .44rem;
  }
  .nav-actions { grid-column: 2; grid-row: 1; }
  .nav-carousel { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; gap: .35rem; }
  .nav-scroll { display: grid; }
  .nav-menu {
    flex: 1 1 auto;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    padding: .08rem;
  }
  .nav-menu::-webkit-scrollbar { display: none; }
  .nav-menu li { scroll-snap-align: start; }
  .nav-menu a {
    padding: .48rem .72rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
  }
  .nav-menu a[aria-current="location"] { box-shadow: none; border-color: var(--accent); }
  .hero { padding-top: 3.8rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-grid .panel { max-width: 680px; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .section { padding: 3.35rem 0; }
  .container { width: min(var(--container), 90%); }
  .cols-2,
  .cols-3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { gap: .72rem; }
  .timeline { padding-left: 1.2rem; }
  .t-item::before { left: -1.71rem; }
  .legal-data > div { grid-template-columns: 1fr; gap: .2rem; }
  .footer-grid { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 460px) {
  section[id] { scroll-margin-top: 128px; }
  body { font-size: 15.5px; }
  .brand-text small { display: none; }
  .brand-badge { width: 36px; height: 36px; border-radius: 10px; }
  .icon-btn { width: 37px; height: 37px; }
  .nav-scroll { width: 34px; height: 34px; }
  .hero { padding: 3.25rem 0 2.7rem; }
  .hero-cta { display: grid; grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .stats { grid-template-columns: 1fr; }
  .panel,
  .card,
  .t-item { padding: 1.14rem; }
  .t-head { align-items: flex-start; flex-direction: column; }
  .contact-actions .btn { width: 100%; }
  .back-to-top { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .reveal { opacity: 1; transform: none; }
  .btn:hover { transform: none; }
}

@media print {
  .site-header,
  .hero-cta,
  .back-to-top,
  #contacto,
  .site-footer { display: none !important; }
  body { background: #fff; color: #000; }
  .section,
  .hero { padding: 1.2rem 0; }
  .card,
  .panel,
  .stat,
  .t-item { box-shadow: none; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}

/* ========================================================================== 
   Ampliaciones de publicación: menú de proyectos, fotografía, principios,
   proyecto local-first y mejoras de legibilidad.
   ========================================================================== */

/* Cada frase importante puede ocupar su propia línea sin fragmentar el texto. */
.text-stack {
  display: grid;
  gap: .72rem;
}
.text-stack > p,
.text-stack > span { margin: 0; }

/* El botón Proyectos comparte el lenguaje visual de los enlaces del menú. */
.nav-link-button {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 36px;
  padding: .5rem .67rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.nav-link-button:hover,
.nav-link-button[aria-expanded="true"],
.nav-link-button[aria-current="location"] {
  background: var(--accent-soft);
  color: var(--text);
}
.nav-link-button[aria-current="location"] { box-shadow: inset 0 -2px 0 var(--accent); }
.nav-caret { width: 14px; height: 14px; transition: transform .16s ease; }
.nav-link-button[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

/* El desplegable se posiciona desde JavaScript para no quedar recortado por el carrusel. */
.projects-popover {
  position: fixed;
  z-index: 180;
  width: min(360px, calc(100vw - 24px));
  filter: drop-shadow(0 20px 36px rgba(21, 31, 48, .2));
}
.projects-popover-inner {
  display: grid;
  gap: .35rem;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}
.projects-popover-link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: .72rem;
  min-height: 64px;
  padding: .65rem .7rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
.projects-popover-link:hover,
.projects-popover-link:focus-visible {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--text);
}
.projects-popover-link.featured {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.projects-popover-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-alt);
  color: var(--accent);
  font-weight: 850;
}
.projects-popover-link strong,
.projects-popover-link small { display: block; }
.projects-popover-link strong { font-size: .9rem; }
.projects-popover-link small { margin-top: .12rem; color: var(--muted); font-size: .75rem; line-height: 1.35; }


/* Estructura jerárquica preparada para incorporar nuevos proyectos. */
.project-tree { gap: .18rem; }
.project-tree-root {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: .55rem;
  min-height: 54px;
  padding: .55rem .65rem;
  border-radius: 11px;
  color: var(--text);
  text-decoration: none;
}
.project-tree-root:hover,
.project-tree-root:focus-visible { background: var(--bg-alt); color: var(--text); }
.project-tree-root-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-2);
  font-weight: 900;
}
.project-tree-root strong,
.project-tree-root small { display: block; }
.project-tree-root strong { font-size: .86rem; }
.project-tree-root small { margin-top: .08rem; color: var(--muted); font-size: .72rem; }
.project-tree-children {
  position: relative;
  display: grid;
  gap: .28rem;
  margin-left: 1.15rem;
  padding-left: 1.05rem;
}
.project-tree-children::before {
  content: "";
  position: absolute;
  left: .18rem;
  top: -.2rem;
  bottom: 1.55rem;
  width: 1px;
  background: var(--line);
}
.project-tree-children .projects-popover-link { position: relative; }
.project-tree-children .projects-popover-link::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 50%;
  width: .82rem;
  height: 1px;
  background: var(--line);
}
.project-logo-mini { font-size: .67rem; letter-spacing: .03em; }

/* Fotografía de bienvenida y panel de credenciales. */
.hero-welcome {
  display: flex;
  align-items: center;
  min-height: 86px;
  margin-bottom: .5rem;
}
.hero-photo-frame {
  width: clamp(72px, 8vw, 92px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 4px solid var(--surface-strong);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.hero-photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.profile-panel { display: block; }
.profile-panel-copy { min-width: 0; }
.profile-availability {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .7rem;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 15%, transparent);
}
.profile-heading { margin-bottom: .9rem; color: var(--text); font-size: 1.22rem; }
.profile-heading::after { display: none; }
.cred-list .check { color: var(--ok); font-weight: 900; }
.cred-list .clock { color: var(--accent-2); font-weight: 900; }
.prep-list { gap: .45rem; }

.hero-motto {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: .78rem;
  max-width: 780px;
  margin-top: 1.25rem;
  padding: .9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent-2) 36%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-2) 7%, var(--surface));
}
.hero-motto-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-2);
  color: var(--on-accent-2);
  font-weight: 900;
}
.hero-motto p { margin: 0; color: var(--text); font-size: .94rem; font-weight: 700; line-height: 1.5; }

/* Principios profesionales y declaración de uso de IA. */
.principles-card { align-self: start; }
.principles-list { display: grid; gap: .62rem; }
.principles-list > div {
  display: grid;
  gap: .12rem;
  padding: .72rem .78rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-alt);
}
.principles-list strong { color: var(--accent); font-size: .88rem; }
.principles-list span { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.ai-disclosure {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.35rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.ai-disclosure-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .08em;
}
.ai-disclosure h3 { margin-bottom: .3rem; color: var(--text); }
.ai-disclosure p { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }

.capability-card { min-height: 255px; }
.credential-list-detailed { display: grid; gap: .58rem; }
.prep-grid { display: grid; gap: .58rem; }
.prep-grid > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: .12rem .62rem;
  padding: .72rem;
  border: 1px dashed var(--accent);
  border-radius: 11px;
  background: var(--accent-soft);
}
.prep-index { grid-row: 1 / 3; color: var(--accent-2); font-size: .78rem; font-weight: 900; }
.prep-grid strong { font-size: .9rem; }
.prep-grid small { color: var(--muted); font-size: .78rem; }

/* Proyecto destacado y explicación visual de la arquitectura local-first. */
.project-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(270px, .75fr);
  gap: 1.45rem;
  margin-top: 1.6rem;
  padding: clamp(1.35rem, 3.4vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent) 6%, var(--surface)), var(--surface)),
    var(--surface);
  box-shadow: var(--shadow);
}
.project-heading-row { display: flex; align-items: center; gap: .9rem; }
.project-heading-row .kicker { margin: 0 0 .1rem; }
.project-heading-row h3 { margin: 0; color: var(--text); font-size: clamp(1.55rem, 3vw, 2.2rem); }
.project-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 17px 17px 17px 5px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  font-size: 1.55rem;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
}
.project-description { margin: 1rem 0 1.15rem; color: var(--muted); }
.project-actions { display: flex; flex-wrap: wrap; gap: .68rem; margin-top: .7rem; }
.project-architecture {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 360px;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-alt);
}
.architecture-node {
  width: min(230px, 100%);
  display: grid;
  justify-items: center;
  gap: .12rem;
  padding: .78rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-strong);
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.architecture-node.primary { border-color: var(--accent); }
.architecture-icon { color: var(--accent); font-size: 1.35rem; font-weight: 900; }
.architecture-node strong { font-size: .9rem; }
.architecture-node small { color: var(--muted); font-size: .75rem; }
.architecture-line { width: 2px; height: 28px; background: linear-gradient(var(--accent), var(--accent-2)); }

.contact-card { align-self: start; }
.footer-copy { max-width: 720px; }
.footer-disclosure { margin-top: .32rem !important; font-size: .74rem; line-height: 1.45; }
.not-found-main { min-height: 65vh; display: grid; align-items: center; }
.not-found-card { max-width: 760px; padding: 2rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }

@media (max-width: 1040px) {
  .nav-link-button { padding-inline: .53rem; font-size: .85rem; }
}

@media (max-width: 920px) {
  .nav-link-button {
    min-height: 36px;
    padding: .48rem .72rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
  }
  .nav-link-button[aria-current="location"] { box-shadow: none; border-color: var(--accent); }
  .profile-panel { max-width: 720px; }
  .project-feature { grid-template-columns: 1fr; }
  .project-architecture { min-height: auto; grid-template-columns: 1fr auto 1fr auto 1fr; gap: .5rem; }
  .architecture-line { width: 28px; height: 2px; }
}

@media (max-width: 680px) {
  .hero-welcome { min-height: 76px; }
  .hero-motto { grid-template-columns: 34px minmax(0, 1fr); padding: .8rem; }
  .hero-motto-mark { width: 34px; height: 34px; }
  .ai-disclosure { grid-template-columns: 1fr; }
  .ai-disclosure-mark { width: 50px; height: 50px; }
  .project-architecture { grid-template-columns: 1fr; }
  .architecture-line { width: 2px; height: 24px; }
  .project-actions { display: grid; }
  .project-actions .btn { width: 100%; }
}

@media (max-width: 460px) {
  .projects-popover { width: calc(100vw - 16px); }
  .projects-popover-inner { padding: .4rem; }
  .projects-popover-link { grid-template-columns: 38px minmax(0, 1fr); padding: .55rem; }
  .project-tree-children { margin-left: .75rem; padding-left: .85rem; }
  .projects-popover-icon { width: 38px; height: 38px; }
  .profile-panel { padding-inline: 1rem; }
  .hero-photo-frame { width: 74px; }
  .ai-disclosure { padding: 1rem; }
  .project-feature { padding: 1rem; }
  .project-heading-row { align-items: flex-start; }
  .project-mark { width: 50px; height: 50px; }
}


/* ========================================================================
   V4 · Sistema visual unificado, cabecera carrusel, búsqueda, reloj y logos
   ======================================================================== */
:root {
  --font-ui: "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --logo-tile: var(--accent);
  --logo-glyph: #ffffff;
  --logo-accent: var(--accent-2);
}
[data-theme="dark"] {
  --logo-tile: var(--accent);
  --logo-glyph: #0b1220;
  --logo-accent: var(--accent-2);
}
body { font-family: var(--font-ui); font-size: clamp(1rem, .25vw + .96rem, 1.06rem); line-height: 1.68; }
h1, h2, h3, h4, .brand, .btn, .nav-menu, .nav-link-button { font-family: var(--font-ui); }
h1 { font-size: clamp(2.35rem, 5vw, 3.6rem); font-weight: 820; line-height: 1.07; letter-spacing: -.035em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.15rem); font-weight: 790; line-height: 1.14; letter-spacing: -.025em; }
h3 { font-size: clamp(1.04rem, 1.2vw, 1.16rem); line-height: 1.32; }
p, li, dd { text-align: left; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

.site-header { box-shadow: 0 1px 0 var(--header-border); }
.nav { grid-template-columns: auto minmax(0, 1fr) auto; gap: .72rem; min-height: 70px; }
.brand-badge,
.project-mark,
.projects-popover-icon.project-logo-mini { padding: 0; overflow: hidden; border: 0; background: transparent; color: var(--accent); box-shadow: none; }
.brand-badge { width: 44px; height: 44px; border-radius: 14px 14px 14px 5px; }
.brand-logo-svg, .grc-logo-svg { display: block; width: 100%; height: 100%; }
.brand-logo-svg .logo-tile, .grc-logo-svg .logo-tile { fill: var(--logo-tile); }
.brand-logo-svg .logo-corner, .grc-logo-svg .logo-corner, .grc-logo-svg .logo-accent-mark { fill: var(--logo-accent); }
.brand-logo-svg .logo-glyph, .brand-logo-svg .logo-subglyph { fill: var(--logo-glyph); font-family: var(--font-ui); }
.grc-logo-svg .logo-glyph { fill: var(--logo-glyph); }
.brand-text { font-size: .96rem; }
.brand-text small { font-size: .74rem; }

.nav-carousel { position: relative; display: grid; grid-template-columns: minmax(138px, 200px) auto minmax(0, 1fr) auto; align-items: center; gap: .38rem; min-width: 0; margin: 0; }
.nav-menu { min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: inline proximity; scrollbar-width: none; justify-content: flex-start; }
.nav-menu::-webkit-scrollbar { display: none; }
.nav-menu li { scroll-snap-align: start; }
.nav-menu a, .nav-link-button { min-height: 40px; padding: .52rem .7rem; font-size: .9rem; }
.nav-scroll { display: none !important; }
.nav-carousel.has-overflow .nav-scroll { display: grid !important; }

.site-search { position: relative; min-width: 0; }
.site-search-icon { position: absolute; z-index: 2; left: .65rem; top: 50%; width: 16px; height: 16px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.site-search input { width: 100%; min-height: 40px; padding: .52rem .7rem .52rem 2rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: 650 .83rem/1.2 var(--font-ui); }
.site-search input::placeholder { color: var(--muted); opacity: .9; }
.site-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.site-search-results { position: absolute; z-index: 220; top: calc(100% + .45rem); left: 0; width: min(350px, calc(100vw - 24px)); max-height: min(420px, 60vh); overflow-y: auto; padding: .38rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-strong); box-shadow: var(--shadow); }
.site-search-result { width: 100%; display: grid; gap: .12rem; padding: .62rem .7rem; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.site-search-result:hover, .site-search-result:focus-visible { background: var(--accent-soft); }
.site-search-result strong { font-size: .86rem; }
.site-search-result small { color: var(--muted); font-size: .73rem; }
.site-search-empty { margin: 0; padding: .7rem; color: var(--muted); font-size: .8rem; }

.nav-actions { gap: .48rem; }
.header-clock { display: grid; grid-template-columns: repeat(2, auto); gap: .18rem .52rem; padding: .36rem .55rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); line-height: 1.05; white-space: nowrap; }
.header-clock span { display: grid; gap: .08rem; }
.header-clock b { color: var(--accent-2); font-size: .56rem; font-weight: 850; letter-spacing: .09em; }
.header-clock time { color: var(--text); font-size: .72rem; font-variant-numeric: tabular-nums; font-weight: 760; }

.hero { padding: 3.7rem 0 3.15rem; }
.hero-welcome { min-height: auto; margin-bottom: .75rem; }
.hero-photo-frame { width: clamp(92px, 9vw, 108px); border-width: 3px; }
.hero h1 { margin-bottom: .42rem; }
.hero-role { max-width: 960px; margin-bottom: 1.15rem; font-size: clamp(1.08rem, 1.7vw, 1.25rem); line-height: 1.55; }
.company-link { color: var(--accent); font-weight: 800; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.company-link:hover { color: var(--accent-2); }
.lead { font-size: clamp(1.04rem, 1.25vw, 1.15rem); line-height: 1.76; }
.text-stack { gap: .76rem; }
.project-mark { width: 60px; height: 60px; border-radius: 17px 17px 17px 5px; }
.projects-popover-icon.project-logo-mini { width: 43px; height: 43px; border-radius: 13px 13px 13px 4px; }
.training-providers { margin: 0 0 .9rem; padding: .75rem .82rem; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-alt); color: var(--muted); font-size: .87rem; }
.training-provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.training-provider-grid section { padding: .82rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.training-provider-grid h4 { margin: 0 0 .45rem; color: var(--accent); font-size: .92rem; }
.training-provider-grid ul { margin: 0; }
.training-provider-grid li { font-size: .86rem; line-height: 1.48; }

@media (hover: hover) and (pointer: fine) {
  .card, .t-item, .panel, .project-feature, .hero-motto, .ai-disclosure, .training-details, .not-found-card, .legal > section, .projects-popover-link { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease; }
  .card:hover, .t-item:hover, .panel:hover, .project-feature:hover, .hero-motto:hover, .ai-disclosure:hover, .training-details:hover, .not-found-card:hover, .legal > section:hover, .projects-popover-link:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); }
}
.back-to-top { right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); width: 48px; height: 48px; border: 2px solid color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--surface-strong); }

@media (max-width: 1080px) {
  .header-clock { grid-template-columns: 1fr; gap: .15rem; }
  .header-clock span { grid-template-columns: auto auto; align-items: baseline; gap: .3rem; }
}
@media (max-width: 920px) {
  .nav { grid-template-columns: minmax(0, 1fr) auto; padding-block: .48rem; }
  .brand { grid-column: 1; }
  .nav-actions { grid-column: 2; }
  .nav-carousel { grid-column: 1 / -1; width: 100%; grid-template-columns: minmax(120px, 180px) auto minmax(0, 1fr) auto; padding-bottom: .42rem; }
  .nav-menu { display: flex; position: static; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .nav-menu a, .nav-link-button { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
  .header-clock { grid-template-columns: repeat(2, auto); }
  .header-clock span { display: grid; gap: .05rem; }
}
@media (max-width: 680px) {
  .container { width: min(94%, var(--container)); }
  .nav { gap: .45rem; }
  .brand-badge { width: 42px; height: 42px; }
  .brand-text { font-size: .9rem; }
  .brand-text small { font-size: .68rem; }
  .nav-actions { gap: .3rem; }
  .header-clock { padding: .3rem .42rem; gap: .35rem; }
  .header-clock b { font-size: .5rem; }
  .header-clock time { font-size: .66rem; }
  .icon-btn { width: 38px; height: 38px; }
  .nav-carousel { grid-template-columns: minmax(112px, 150px) auto minmax(0, 1fr) auto; gap: .28rem; }
  .site-search input { min-height: 38px; font-size: .78rem; }
  .nav-scroll { width: 34px; height: 34px; }
  .nav-menu a, .nav-link-button { min-height: 38px; padding: .48rem .65rem; font-size: .83rem; }
  .hero { padding-top: 2.7rem; }
  .hero-photo-frame { width: 88px; }
  h1 { font-size: clamp(2.18rem, 10vw, 3rem); }
  h2 { font-size: clamp(1.55rem, 7vw, 1.95rem); }
  .hero-role { font-size: 1.05rem; line-height: 1.58; }
  .lead { font-size: 1rem; line-height: 1.72; }
  .training-provider-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .brand-text small { display: none; }
  .header-clock { display: none; }
  .nav-carousel { grid-template-columns: minmax(105px, 132px) auto minmax(0, 1fr) auto; }
  .site-search-results { position: fixed; top: 116px; left: 8px; right: 8px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .t-item, .panel, .project-feature, .hero-motto, .ai-disclosure, .training-details, .legal > section { transition: none !important; transform: none !important; }
}


/* V5 · Logotipos oficiales embebidos suministrados por el titular */
.embedded-logo{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
.brand-badge{width:50px;height:50px;flex:0 0 50px;padding:0;overflow:hidden;border-radius:50%;background:#081426;border:1px solid color-mix(in srgb,var(--accent-2) 48%,var(--line));box-shadow:0 5px 16px rgba(11,18,32,.22)}
.brand-logo-image,.project-logo-image,.project-mark-image,.heading-logo-image,.footer-brand-logo-image,.inline-project-logo{border-radius:50%}
.projects-popover-icon.project-logo-mini{width:48px;height:48px;border-radius:50%;overflow:hidden;background:#081426;border:1px solid color-mix(in srgb,var(--accent-2) 42%,var(--line));box-shadow:0 4px 12px rgba(11,18,32,.18)}
.project-mark{padding:0;overflow:hidden;border-radius:50%;background:#081426;border:1px solid color-mix(in srgb,var(--accent-2) 46%,var(--line));box-shadow:0 8px 22px rgba(11,18,32,.22)}
.inline-project-logo-wrap{display:inline-grid;place-items:center;width:26px;height:26px;flex:0 0 26px;overflow:hidden;border-radius:50%;background:#081426;border:1px solid color-mix(in srgb,var(--accent-2) 45%,var(--line))}
.heading-with-logo{display:flex;align-items:center;gap:.75rem}
.heading-logo{display:inline-grid;width:46px;height:46px;flex:0 0 46px;overflow:hidden;border-radius:50%;background:#081426;border:1px solid color-mix(in srgb,var(--accent-2) 45%,var(--line))}
.footer-copy{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:.85rem;align-items:start}
.footer-brand-logo{grid-row:1/span 2;display:inline-grid;width:52px;height:52px;overflow:hidden;border-radius:50%;background:#081426;border:1px solid color-mix(in srgb,var(--accent-2) 45%,var(--line));box-shadow:0 5px 16px rgba(11,18,32,.18)}
.footer-copy>p{grid-column:2}
@media(max-width:640px){.brand-badge{width:46px;height:46px;flex-basis:46px}.projects-popover-icon.project-logo-mini{width:44px;height:44px}.heading-logo{width:40px;height:40px;flex-basis:40px}.footer-brand-logo{width:46px;height:46px}}


/* ========================================================================== 
   V6 · Ensanchamiento general, identidad del hero y pictograma de IA
   ========================================================================== */

/* Aprovecha mejor pantallas anchas sin sacrificar márgenes seguros. */
.container {
  width: min(var(--container), calc(100% - clamp(2rem, 4vw, 4.5rem)));
}
.legal { max-width: 96ch; }
.lead { max-width: 82ch; }

/* Cabecera más amplia: identidad, búsqueda y navegación caben antes de activar
   el desplazamiento horizontal accesible. */
.nav { min-height: 76px; gap: 1rem; }
.nav-carousel {
  grid-template-columns: minmax(190px, 260px) auto minmax(0, 1fr) auto;
  gap: .48rem;
}
.site-search input { min-height: 42px; }
.nav-menu a,
.nav-link-button { padding-inline: .78rem; }

/* El retrato abre la presentación y queda alineado a la izquierda del nombre. */
.hero { padding-block: 4.25rem 3.4rem; }
.hero-grid {
  grid-template-columns: minmax(0, 1.48fr) minmax(370px, .68fr);
  gap: clamp(2.2rem, 4.5vw, 5.4rem);
}
.hero-identity {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.45rem);
  margin-bottom: .8rem;
}
.hero-identity-copy { min-width: 0; }
.hero-identity-copy .kicker { margin-bottom: .3rem; }
.hero-identity-copy h1 { margin: 0; }
.hero-photo-frame {
  width: clamp(108px, 7vw, 126px);
  flex: 0 0 auto;
}
.hero-role { max-width: 1080px; }
.hero-copy > .lead { max-width: 88ch; }
.profile-panel { min-width: 0; }

/* Logotipos algo mayores y consistentes en todos sus puntos de uso. */
.brand-badge { width: 58px; height: 58px; flex-basis: 58px; }
.projects-popover-icon.project-logo-mini { width: 56px; height: 56px; }
.project-mark { width: 72px; height: 72px; }
.inline-project-logo-wrap { width: 30px; height: 30px; flex-basis: 30px; }
.heading-logo { width: 54px; height: 54px; flex-basis: 54px; }
.footer-brand-logo { width: 60px; height: 60px; }

/* Cerebro digital dentro de una nube: icono propio, simple y legible. */
.ai-disclosure { grid-template-columns: 76px minmax(0, 1fr); align-items: center; }
.ai-disclosure-mark {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  color: var(--on-accent);
}
.brain-cloud-icon { width: 48px; height: 48px; }

@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 2.4rem; }
  .nav-carousel { grid-template-columns: minmax(160px, 220px) auto minmax(0, 1fr) auto; }
}

@media (max-width: 920px) {
  .container { width: min(var(--container), calc(100% - 2rem)); }
  .hero-grid { grid-template-columns: 1fr; }
  .profile-panel { max-width: 780px; }
  .nav-carousel { grid-template-columns: minmax(130px, 185px) auto minmax(0, 1fr) auto; }
}

@media (max-width: 680px) {
  .container { width: min(var(--container), calc(100% - 1.5rem)); }
  .brand-badge { width: 50px; height: 50px; flex-basis: 50px; }
  .hero-identity { align-items: center; gap: .85rem; }
  .hero-photo-frame { width: 94px; }
  .hero-identity-copy h1 { font-size: clamp(2.05rem, 9.5vw, 2.75rem); }
  .projects-popover-icon.project-logo-mini { width: 48px; height: 48px; }
  .project-mark { width: 64px; height: 64px; }
  .heading-logo { width: 46px; height: 46px; flex-basis: 46px; }
  .footer-brand-logo { width: 52px; height: 52px; }
  .ai-disclosure { grid-template-columns: 60px minmax(0, 1fr); }
  .ai-disclosure-mark { width: 54px; height: 54px; }
  .brain-cloud-icon { width: 39px; height: 39px; }
}

@media (max-width: 430px) {
  .hero-identity { align-items: flex-start; }
  .hero-photo-frame { width: 82px; }
  .hero-identity-copy .kicker { font-size: .66rem; letter-spacing: .1em; }
  .hero-identity-copy h1 { font-size: clamp(1.88rem, 9vw, 2.35rem); line-height: 1.08; }
}


/* ========================================================================
   V7 · Búsqueda operativa, reloj en vivo, jerarquía de capacidades y refinado
   ======================================================================== */

/* La función profesional se presenta en dos líneas deliberadas. */
.hero-role-language { display: grid; gap: .16rem; }
.hero-role-line { display: block; }
.hero-employer-line { line-height: 1.42; }
.hero-domain-line { line-height: 1.55; }

/* Subtítulos normativos: el título describe la capacidad y la segunda línea
   identifica los principales estándares, normas o marcos relacionados. */
.capability-card h3 { margin-bottom: .26rem; }
.capability-frameworks {
  margin: 0 0 .72rem !important;
  color: var(--accent-2) !important;
  font-size: .76rem !important;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: .035em;
}

/* Los resultados del buscador deben permanecer visibles por encima del hero. */
.site-header,
.site-header .nav,
.site-header .nav-carousel,
.site-header .site-search { overflow: visible; }
.site-search-results {
  z-index: 1000;
  min-width: min(350px, calc(100vw - 24px));
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
}
.site-search-result { cursor: pointer; }

/* Reloj verdaderamente vivo: segundos visibles y cifras de ancho estable. */
.header-clock time { min-width: 8ch; font-variant-numeric: tabular-nums; }

/* Pictograma de IA coherente con la paleta global, sin bloque azul dominante. */
.ai-disclosure-mark {
  border: 1px solid color-mix(in srgb, var(--accent-2) 48%, var(--line));
  background: color-mix(in srgb, var(--surface-strong) 92%, var(--accent-2) 8%);
  color: var(--accent-2);
  box-shadow: var(--shadow-soft);
}
.brain-cloud-icon { width: 47px; height: 47px; }

@media (max-width: 680px) {
  .capability-frameworks { font-size: .72rem !important; }
  .hero-role-language { gap: .12rem; }
  .brain-cloud-icon { width: 38px; height: 38px; }
}

/* ======================================================================
   V8 · Búsqueda compacta, coincidencias exactas y carruseles táctiles
   ====================================================================== */
.site-search {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: visible;
  transition: width .2s ease, flex-basis .2s ease;
}
.site-search-toggle {
  position: relative;
  z-index: 5;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.site-search-toggle:hover,
.site-search-toggle:focus-visible,
.site-search.is-open .site-search-toggle {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.site-search-toggle .site-search-icon,
.site-search-toggle svg {
  position: static;
  width: 18px;
  height: 18px;
  transform: none;
  color: currentColor;
  pointer-events: none;
}
.site-search input {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: .56rem .75rem .56rem 2.7rem;
  opacity: 0;
  pointer-events: none;
  transition: width .2s ease, opacity .15s ease;
}
.site-search.is-open,
.site-search:focus-within {
  width: min(310px, 34vw);
  flex-basis: min(310px, 34vw);
}
.site-search.is-open input,
.site-search:focus-within input {
  width: min(310px, 34vw);
  opacity: 1;
  pointer-events: auto;
}
.site-search.is-open .site-search-toggle,
.site-search:focus-within .site-search-toggle {
  border-right-color: transparent;
  background: transparent;
}
.site-search-results {
  top: calc(100% + .5rem);
  left: 0;
  width: min(460px, calc(100vw - 24px));
  max-height: min(520px, 66vh);
}
.site-search-result {
  gap: .22rem;
  padding: .7rem .78rem;
}
.site-search-result strong {
  overflow: hidden;
  color: var(--text);
  font-size: .88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-search-result small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
mark.search-hit {
  border-radius: .25em;
  padding: .05em .16em;
  background: color-mix(in srgb, var(--accent-2) 42%, #fff);
  color: #17120a;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 22%, transparent);
}
mark.search-hit:focus { outline: 3px solid var(--accent); outline-offset: 4px; }

@media (max-width: 820px) {
  .site-search {
    order: -1;
    width: 42px;
    min-width: 42px;
    flex-basis: 42px;
  }
  .site-search.is-open,
  .site-search:focus-within {
    width: 42px;
    flex-basis: 42px;
  }
  .site-search input,
  .site-search.is-open input,
  .site-search:focus-within input {
    position: fixed;
    z-index: 310;
    top: 68px;
    left: 8px;
    width: calc(100vw - 16px);
    max-width: none;
    border-radius: 12px;
    box-shadow: var(--shadow);
  }
  .site-search-results {
    position: fixed;
    z-index: 309;
    top: 116px;
    right: 8px;
    left: 8px;
    width: auto;
    max-height: min(58vh, 520px);
  }
}

@media (max-width: 760px) {
  .touch-carousel {
    display: flex !important;
    grid-template-columns: none !important;
    gap: .9rem !important;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 1rem;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
  }
  .touch-carousel.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
  .touch-carousel > * {
    min-width: min(86vw, 440px);
    flex: 0 0 min(86vw, 440px);
    scroll-snap-align: start;
  }
  .stats.touch-carousel > * { min-width: min(70vw, 300px); flex-basis: min(70vw, 300px); }
  .touch-carousel::after { content: ""; flex: 0 0 .1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .site-search, .site-search input { transition: none; }
}
