/* Shared navigation and theme roles; the accepted page composition stays intact. */
:root { --header-height: 80px; color-scheme: dark; --header-surface: #101312f5; --button-text: #142010; }
html { scroll-padding-top: calc(var(--header-height) + 24px); }
body { padding-top: var(--header-height); }
/* Reserve the fixed header once, through scroll-padding on html. */
[id] { scroll-margin-top: 0; }
.site-header { position: fixed; inset: 0 0 auto; z-index: 1000; background: var(--header-surface); border-bottom: 1px solid var(--borde-brillante); backdrop-filter: blur(16px); }
.site-header-inner { display: flex; align-items: center; gap: 32px; min-height: var(--header-height); max-width: 1240px; padding: 0 48px; margin-inline: auto; }
.site-header .home-brand { flex-shrink: 0; margin-right: auto; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a { color: var(--texto-suave); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; font-size: .85rem; }
.site-nav a:hover { color: var(--primario); }
.site-nav .nav-contact { color: var(--texto); }
.site-preferences { display: flex; align-items: center; gap: 8px; }
.site-preferences button,.site-preferences select,.cv-link { border: 1px solid transparent; background: transparent; color: var(--texto); min-width: 44px; height: 44px; border-radius: 5px; font: 500 .8rem var(--familia-fuente); cursor: pointer; }
.site-preferences button,.cv-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.site-preferences select { padding: 0 7px; background-color: var(--fondo); }
.site-preferences button:hover,.site-preferences select:hover { background-color: var(--superficie-hover); border-color: var(--borde-brillante); }
.site-preferences svg { width: 20px; height: 20px; }
.site-preferences .cv-link { padding-inline: 12px; border-color: var(--borde-brillante); text-decoration: none; }
.site-preferences .cv-link:hover { border-color: var(--primario); color: var(--primario); }
.site-preferences .menu-toggle { display: none; }
.moon-icon { display: none; }
.case-page::before { display: none; }
.case-page .espacio-proyecto { width: 100%; padding-top: 28px; }
.case-page .contenedor-principal { min-height: calc(100vh - var(--header-height)); }
.case-page .contenido-proyecto h1 { margin-bottom: 22px; }
.case-page .contenido-proyecto .primary-link { color: var(--button-text); }

/* The fixed navbar is already reserved by body padding: count it only once. */
.intro-stage { display: flex; flex-direction: column; min-height: calc(100vh - var(--header-height)); min-height: calc(100dvh - var(--header-height)); }
.intro-stage .home-hero { flex: 1 0 auto; align-content: center; }
.intro-stage .skills-carousel { flex: 0 0 auto; }
/* Intrinsic content can grow beyond one view on mobile, zoom, or short screens. */
@media (min-width: 901px) {
  .intro-stage { --intro-bottom-space: clamp(24px,5vh,48px); --intro-bottom-space: clamp(24px,5dvh,48px); padding-bottom: var(--intro-bottom-space); }
  .home-hero { padding: clamp(28px,5vh,64px) 0 calc(clamp(24px,4vh,48px) + var(--intro-bottom-space)); gap: clamp(40px,5vw,80px); }
  .home-hero h1 { font-size: clamp(3.8rem,min(7.2vw,11vh),6.6rem); margin: 22px 0; }
  .home-hero .primary-link { margin-top: 24px; }
  .portfolio-home .skills-carousel { padding-block: 20px; }
}

html[data-theme="light"] {
  color-scheme: light;
  --fondo: #f5f5ef;
  --superficie: #ffffff;
  --superficie-hover: #e9eee5;
  --texto: #17251b;
  --texto-suave: #4c5c50;
  --texto-oscuro: #4c5c50;
  --primario: #346b37;
  --secundario: #346b37;
  --acento: #346b37;
  --borde: #d6ded2;
  --borde-brillante: #c3cfbf;
  --header-surface: #f5f5eff5;
  --button-text: #ffffff;
}
html[data-theme="light"] .sun-icon { display: none; }
html[data-theme="light"] .moon-icon { display: block; }
html[data-theme="light"] .primary-link { color: var(--button-text); }
html[data-theme="light"] .primary-link:hover { background: #28532b; }
html[data-theme="light"] .hero-note p,html[data-theme="light"] .visual-caption,html[data-theme="light"] .portfolio-home .skills-set .tech-name { color: var(--texto); }
html[data-theme="light"] .published-grid .work-card { border-color: var(--borde-brillante); }
html[data-theme="light"] .published-grid .work-card:hover { background: #f8fbf5; border-color: #779970; }
html[data-theme="light"] .project-visual { background: radial-gradient(ellipse at 50% 80%,#d9e8cd,transparent 75%),linear-gradient(145deg,#e6edde,#f0f4e9); border-color: var(--borde-brillante); }
html[data-theme="light"] .project-visual::before { background-image: linear-gradient(#527e3f1a 1px,transparent 1px),linear-gradient(90deg,#527e3f1a 1px,transparent 1px); }
html[data-theme="light"] .timeline .infrastructure-case { background: linear-gradient(145deg,#e8efe0,#f0f4e9); border-color: #bccdb4; }
@media (max-width: 1000px) { .site-header-inner { gap: 20px; } .site-nav { gap: 18px; } .site-nav .nav-contact { display: none; } }
@media (max-width: 900px) {
  :root { --header-height: 72px; }
  .site-header-inner { padding-inline: 28px; gap: 12px; }
  .site-preferences .menu-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 16px 28px 24px; background: var(--fondo); border-bottom: 1px solid var(--borde-brillante); box-shadow: 0 18px 30px #00000014; }
  .menu-open .site-nav { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  .site-nav a { font-size: 1rem; padding-inline: 8px; }
  .site-nav .nav-contact { display: flex; }
}
@media (max-width: 600px) {
  .site-header-inner { padding-inline: 22px; }
  .site-preferences { gap: 4px; }
  .site-preferences .cv-link { padding-inline: 10px; }
  .site-header .home-brand { font-size: 28px; }
  .site-nav { padding-inline: 22px; }
}
@media (max-width: 350px) { .site-header-inner { padding-inline: 14px; gap: 4px; } .site-preferences { gap: 0; } .site-preferences .cv-link { padding-inline: 6px; } }

.route-anchor { display: block; }

/* ponytail: keep layout rules; the removed motion runtime is not needed for geometry. */
#proyectos .art-capture {padding:20px 0;min-width:0}
#proyectos .art-capture img {display:block;width:100%;height:auto;border-radius:5px;box-shadow:0 14px 28px #00000020}
.preview-motion {display:block;width:100%;position:relative;overflow:hidden;border-radius:5px}
.project-entry,.project-depth,.project-depth>svg {display:block;width:100%}
.hero-word {display:inline-block}
html {scroll-behavior:auto}


/* 21st Deploy Pipeline inspiration: stages and connected equipment, native to this site.
   ponytail: static illustration; existing motion mode needs no extra controller. */
.timeline .hosting-flow { margin: 32px 0 0; padding: 28px 0 24px; border-block: 1px solid var(--borde-brillante); }
.hosting-flow figcaption { color: var(--texto-suave); font-size: .9rem; line-height: 1.6; max-width: 55ch; }
.hosting-flow ol { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; list-style: none; padding: 0; margin: 22px 0 0; }
.hosting-flow li { position: relative; display: grid; align-content: start; min-width: 0; gap: 12px; }
.hosting-flow li:not(:last-child)::after { content: ""; position: absolute; top: 60px; left: 110px; right: -18px; height: 1px; background: var(--borde-brillante); }
.hosting-node { display: block; width: 120px; max-width: 100%; color: var(--primario); }
.hosting-node svg { display: block; width: 100%; height: auto; overflow: visible; }
.host-block-top { fill: var(--superficie-hover); stroke: currentColor; stroke-width: 1; }
.host-block-front { fill: var(--superficie); stroke: currentColor; stroke-width: 1; }
.host-block-side { fill: var(--fondo); stroke: currentColor; stroke-width: 1; }
.host-block-slot { fill: none; stroke: currentColor; opacity: .6; stroke-linecap: round; }
.host-block-light { fill: currentColor; }
.hosting-flow strong { display: block; font: 500 1.15rem/1.4 var(--familia-header); color: var(--texto); }
.hosting-flow li div > span { display: block; margin-top: 4px; color: var(--texto-suave); font-size: .85rem; line-height: 1.6; }
@media (max-width: 900px) {
  .timeline .hosting-flow { margin-top: 26px; padding-block: 24px; }
  .hosting-flow ol { grid-template-columns: 1fr; gap: 22px; margin-top: 20px; }
  .hosting-flow li { grid-template-columns: 80px minmax(0,1fr); align-items: center; gap: 20px; }
  .hosting-flow li:not(:last-child)::after { top: 72px; bottom: -28px; left: 40px; right: auto; width: 1px; height: auto; }
  .hosting-node { width: 80px; }
  .hosting-flow strong { font-size: 1.05rem; }
}
